schema_salad.dlang_codegen
D code generator for a given schema salad definition.
Classes
Generation of D code for a given Schema Salad definition. |
Functions
|
Return True if a given field only takes the specified string. |
|
Return a list of constant fields name from a given record schema. |
|
Return True if a given list of types are dispatchable. |
Module Contents
- class schema_salad.dlang_codegen.DlangCodeGen(base, target, examples, package, copyright_, parser_info, salad_version)
Bases:
digraph inheritancef362c970f6 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CodeGenBase" [URL="../codegen_base/index.html#schema_salad.codegen_base.CodeGenBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract base class for schema salad code generators."]; "DlangCodeGen" [URL="#schema_salad.dlang_codegen.DlangCodeGen",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generation of D code for a given Schema Salad definition."]; "CodeGenBase" -> "DlangCodeGen" [arrowsize=0.5,style="setlinewidth(0.5)"]; }schema_salad.codegen_base.CodeGenBase
Generation of D code for a given Schema Salad definition.
- Parameters:
- base_uri
- examples
- target
- package
- copyright
- parser_info
- salad_version
- prologue()
Trigger to generate the prolouge code.
- Return type:
None
- epilogue(root_loader)
Trigger to generate the epilouge code.
- Parameters:
root_loader (schema_salad.codegen_base.TypeDef)
- Return type:
None
- static safe_name(name)
Generate a safe version of the given name.
- to_doc_comment(doc)
Return an embedded documentation comments for a given string.
- parse_record_field_type(type_, jsonld_pred, parent_has_idmap=False, has_default=False)
Return an annotation string and a type string.
- parse_record_field(field, parent_name=None)
Return a declaration string for a given record field.
- parse_record_schema(stype)
Return a declaration string for a given record schema.
- parse_enum(stype)
Return a declaration string for a given enum schema.
- parse_union(stype)
Return a declaration string for a given union schema.
- parse_map(stype)
Return a declaration string for a given map schema.
- schema_salad.dlang_codegen.is_constant_field(field)
Return True if a given field only takes the specified string.