Skip to content

UAVCAN DSDL processing front end implemented in Python

License

Notifications You must be signed in to change notification settings

coderkalyan/pydsdl

 
 

Repository files navigation

PyDSDL

Build status Documentation Status PyPI - Downloads Forum

PyDSDL is a UAVCAN DSDL compiler front-end implemented in Python. It accepts a DSDL namespace at the input and produces a well-annotated abstract syntax tree (AST) at the output, evaluating all constant expressions in the process. All DSDL features defined in the UAVCAN Specification are supported. The library should, in theory, work on any platform and with any Python implementation.

Read the docs at pydsdl.readthedocs.io.

import pydsdl
try:
    types = pydsdl.read_namespace(target_directory, lookup_directories)
except pydsdl.InvalidDefinitionError as ex:
    print(f'{ex.path}:{ex.line}: Invalid DSDL: {ex.text}', file=sys.stderr)
    exit(1)
else:
    for t in types:
        print(t)  # Process the type -- generate code, analyze, etc.

About

UAVCAN DSDL processing front end implemented in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.7%
  • Shell 0.3%