Namespaces | Classes | Functions | Variables
libuavcan_dsdl_compiler Namespace Reference

Namespaces

 pyratemp
 

Classes

class  DsdlCompilerException
 

Functions

def die (text)
 
def generate_one_type (template_expander, t)
 
def make_template_expander (filename)
 
def makedirs (path)
 
def pretty_filename (filename)
 
def run (source_dirs, include_dirs, output_dir)
 
def run_generator (types, dest_dir)
 
def run_parser (source_dirs, search_dirs)
 
def type_output_filename (t)
 
def type_to_cpp_type (t)
 
def write_generated_data (filename, data)
 

Variables

list __all__ = ['run', 'logger', 'DsdlCompilerException']
 
 logger = logging.getLogger(__name__)
 
string OUTPUT_FILE_EXTENSION = 'hpp'
 
int OUTPUT_FILE_PERMISSIONS = 0o444
 
 str = unicode
 
 TEMPLATE_FILENAME = os.path.join(os.path.dirname(__file__), 'data_type_template.tmpl')
 

Function Documentation

◆ die()

def libuavcan_dsdl_compiler.die (   text)

Definition at line 89 of file libuavcan_dsdl_compiler/__init__.py.

◆ generate_one_type()

def libuavcan_dsdl_compiler.generate_one_type (   template_expander,
  t 
)

Definition at line 167 of file libuavcan_dsdl_compiler/__init__.py.

◆ make_template_expander()

def libuavcan_dsdl_compiler.make_template_expander (   filename)
Templating is based on pyratemp (http://www.simple-is-better.org/template/pyratemp.html).
The pyratemp's syntax is rather verbose and not so human friendly, so we define some
custom extensions to make it easier to read and write.
The resulting syntax somewhat resembles Mako (which was used earlier instead of pyratemp):
    Substitution:
        ${expression}
    Line joining through backslash (replaced with a single space):
        ${foo(bar(very_long_arument=42, \
                  second_line=72))}
    Blocks:
        % for a in range(10):
            % if a == 5:
                ${foo()}
            % endif
        % endfor
The extended syntax is converted into pyratemp's through regexp substitution.

Definition at line 246 of file libuavcan_dsdl_compiler/__init__.py.

◆ makedirs()

def libuavcan_dsdl_compiler.makedirs (   path)

Definition at line 79 of file libuavcan_dsdl_compiler/__init__.py.

◆ pretty_filename()

def libuavcan_dsdl_compiler.pretty_filename (   filename)

Definition at line 67 of file libuavcan_dsdl_compiler/__init__.py.

◆ run()

def libuavcan_dsdl_compiler.run (   source_dirs,
  include_dirs,
  output_dir 
)
This function takes a list of root namespace directories (containing DSDL definition files to parse), a
possibly empty list of search directories (containing DSDL definition files that can be referenced from the types
that are going to be parsed), and the output directory path (possibly nonexistent) where the generated C++
header files will be stored.

Note that this module features lazy write, i.e. if an output file does already exist and its content is not going
to change, it will not be overwritten. This feature allows to avoid unnecessary recompilation of dependent object
files.

Args:
    source_dirs    List of root namespace directories to parse.
    include_dirs   List of root namespace directories with referenced types (possibly empty). This list is
                   automaitcally extended with source_dirs.
    output_dir     Output directory path. Will be created if doesn't exist.

Definition at line 37 of file libuavcan_dsdl_compiler/__init__.py.

◆ run_generator()

def libuavcan_dsdl_compiler.run_generator (   types,
  dest_dir 
)

Definition at line 100 of file libuavcan_dsdl_compiler/__init__.py.

◆ run_parser()

def libuavcan_dsdl_compiler.run_parser (   source_dirs,
  search_dirs 
)

Definition at line 92 of file libuavcan_dsdl_compiler/__init__.py.

◆ type_output_filename()

def libuavcan_dsdl_compiler.type_output_filename (   t)

Definition at line 75 of file libuavcan_dsdl_compiler/__init__.py.

◆ type_to_cpp_type()

def libuavcan_dsdl_compiler.type_to_cpp_type (   t)

Definition at line 138 of file libuavcan_dsdl_compiler/__init__.py.

◆ write_generated_data()

def libuavcan_dsdl_compiler.write_generated_data (   filename,
  data 
)

Definition at line 114 of file libuavcan_dsdl_compiler/__init__.py.

Variable Documentation

◆ __all__

list libuavcan_dsdl_compiler.__all__ = ['run', 'logger', 'DsdlCompilerException']
private

Definition at line 30 of file libuavcan_dsdl_compiler/__init__.py.

◆ logger

libuavcan_dsdl_compiler.logger = logging.getLogger(__name__)

Definition at line 35 of file libuavcan_dsdl_compiler/__init__.py.

◆ OUTPUT_FILE_EXTENSION

string libuavcan_dsdl_compiler.OUTPUT_FILE_EXTENSION = 'hpp'

Definition at line 26 of file libuavcan_dsdl_compiler/__init__.py.

◆ OUTPUT_FILE_PERMISSIONS

int libuavcan_dsdl_compiler.OUTPUT_FILE_PERMISSIONS = 0o444

Definition at line 27 of file libuavcan_dsdl_compiler/__init__.py.

◆ str

libuavcan_dsdl_compiler.str = unicode

Definition at line 22 of file libuavcan_dsdl_compiler/__init__.py.

◆ TEMPLATE_FILENAME

libuavcan_dsdl_compiler.TEMPLATE_FILENAME = os.path.join(os.path.dirname(__file__), 'data_type_template.tmpl')

Definition at line 28 of file libuavcan_dsdl_compiler/__init__.py.



uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04