xsm-parser


Namexsm-parser JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryExecutable Shlaer-Mellor State Model Parser
upload_time2023-08-20 21:50:15
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2019-2023 Leon Starr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords action language executable uml state model state machine mbse xuml xtuml platform independent sysml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Executable State Model Parser

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

### Why you need this

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

### Installation

Create or use a python 3.11+ environment. Then

% pip install xsm-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 xsm-parser.parser import StateModelParser

You then specify a path as shown:

    result = StateModelParser.parse_file(file_input=path_to_file, debug=False)

Check the code in `parser.py` to verify I haven't changed these parameters on you wihtout updating the readme.

In either case, `result` will be a list of parsed scrall statements. 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...

    % xsm cabin.xsm

The .xsm extension is not necessary, but the file must contain xsm text. See this repository's wiki for
more about the xsm language. The grammar is defined in the [state_model.peg](https://github.com/modelint/xsm-parser/blob/main/src/xsm_parser/state_model.peg) file. (if the link breaks after I do some update to the code, 
just browse through the code looking for the state_model.peg file, and let me know so I can fix it)

You can also specify a debug option like this:

    % xsm cabin.xsm -D

This will create a diagnostics folder in your current working directory and deposit a couple of PDFs defining
the parse of both the state model grammar: `state_model_tree.pdf` and your supplied text: `state_model.pdf`.

You should also see a file named `xsm-parser.log` in a diagnostics directory within your working directory

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "xsm-parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "action language,executable uml,state model,state machine,mbse,xuml,xtuml,platform independent,sysml",
    "author": "",
    "author_email": "Leon Starr <leon_starr@modelint.com>",
    "download_url": "https://files.pythonhosted.org/packages/05/7c/f6ce89de75dfcfdb774bf119344d97b90034051a6e6d6dcfcd9815d7a351/xsm-parser-0.1.2.tar.gz",
    "platform": null,
    "description": "# Executable State Model Parser\n\nParses an *.xsm file (Executable State Model) to yield an abstract syntax tree using python named tuples\n\n### Why you need this\n\nYou need to process an *.xsm file in preparation for populating a database or some other purpose\n\n### Installation\n\nCreate or use a python 3.11+ environment. Then\n\n% pip install xsm-parser\n\nAt this point you can invoke the parser via the command line or from your python script.\n\n#### From your python script\n\nYou need this import statement at a minimum:\n\n    from xsm-parser.parser import StateModelParser\n\nYou then specify a path as shown:\n\n    result = StateModelParser.parse_file(file_input=path_to_file, debug=False)\n\nCheck the code in `parser.py` to verify I haven't changed these parameters on you wihtout updating the readme.\n\nIn either case, `result` will be a list of parsed scrall statements. You may find the header of the `visitor.py`\nfile helpful in interpreting these results.\n\n#### From the command line\n\nThis is not the intended usage scenario, but may be helpful for testing or exploration. Since the parser\nmay generate some diagnostic info you may want to create a fresh working directory and cd into it\nfirst. From there...\n\n    % xsm cabin.xsm\n\nThe .xsm extension is not necessary, but the file must contain xsm text. See this repository's wiki for\nmore about the xsm language. The grammar is defined in the [state_model.peg](https://github.com/modelint/xsm-parser/blob/main/src/xsm_parser/state_model.peg) file. (if the link breaks after I do some update to the code, \njust browse through the code looking for the state_model.peg file, and let me know so I can fix it)\n\nYou can also specify a debug option like this:\n\n    % xsm cabin.xsm -D\n\nThis will create a diagnostics folder in your current working directory and deposit a couple of PDFs defining\nthe parse of both the state model grammar: `state_model_tree.pdf` and your supplied text: `state_model.pdf`.\n\nYou should also see a file named `xsm-parser.log` in a diagnostics directory within your working directory\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2019-2023 Leon Starr  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Executable Shlaer-Mellor State Model Parser",
    "version": "0.1.2",
    "project_urls": {
        "documentation": "https://github.com/modelint/xsm-parser/wiki",
        "repository": "https://github.com/modelint/xsm-parser"
    },
    "split_keywords": [
        "action language",
        "executable uml",
        "state model",
        "state machine",
        "mbse",
        "xuml",
        "xtuml",
        "platform independent",
        "sysml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52dd2cbe2e21fa8c298a2cad0fc8f49b85cba4e471ce676dddbfa553ffc4a162",
                "md5": "33372efeb3097647d6bd42a8ef2657d3",
                "sha256": "b253b4e495777a1e97ace586ba3207d9e4442d651cf69545354e519f2b8492d5"
            },
            "downloads": -1,
            "filename": "xsm_parser-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33372efeb3097647d6bd42a8ef2657d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 11696,
            "upload_time": "2023-08-20T21:50:14",
            "upload_time_iso_8601": "2023-08-20T21:50:14.448674Z",
            "url": "https://files.pythonhosted.org/packages/52/dd/2cbe2e21fa8c298a2cad0fc8f49b85cba4e471ce676dddbfa553ffc4a162/xsm_parser-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "057cf6ce89de75dfcfdb774bf119344d97b90034051a6e6d6dcfcd9815d7a351",
                "md5": "300bf9d54a5857599cad57dac0af3b92",
                "sha256": "57e0d963aa854704cd9373e3bae59a5a2a7fd773a48ab9445089597d7f9f2a53"
            },
            "downloads": -1,
            "filename": "xsm-parser-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "300bf9d54a5857599cad57dac0af3b92",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 11243,
            "upload_time": "2023-08-20T21:50:15",
            "upload_time_iso_8601": "2023-08-20T21:50:15.975150Z",
            "url": "https://files.pythonhosted.org/packages/05/7c/f6ce89de75dfcfdb774bf119344d97b90034051a6e6d6dcfcd9815d7a351/xsm-parser-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-20 21:50:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "modelint",
    "github_project": "xsm-parser",
    "github_not_found": true,
    "lcname": "xsm-parser"
}
        
Elapsed time: 0.22787s