File: __init__.py

package info (click to toggle)
python-tatsu 5.15.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: python: 10,128; makefile: 54
file content (18 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from __future__ import annotations

from ..exceptions import CodegenError
from .cgbase import (  # noqa: F401
    CodeGenerator,
    DelegatingRenderingFormatter,
    ModelRenderer,
    NullModelRenderer,
)


def codegen(model, target='python'):
    if target.lower() == 'python':
        from tatsu.codegen import python

        return python.codegen(model)
    else:
        raise CodegenError(f'Unknown target language: {target}')