Documentation ¶
Index ¶
- type GeneratedType
- type PythonExprGenerator
- func (g PythonExprGenerator) GenerateBinopExpr(expr *definition.BinopExpr) (string, error)
- func (g PythonExprGenerator) GenerateCastExpr(expr *definition.CastExpr) (string, error)
- func (g PythonExprGenerator) GenerateConstantExpr(expr *definition.ConstantExpr) (string, error)
- func (g PythonExprGenerator) GenerateExpr(expr definition.Expr) (string, error)
- func (g PythonExprGenerator) GenerateRawExpr(expr *definition.RawExpr) (string, error)
- func (g PythonExprGenerator) GenerateTenaryExpr(expr *definition.TenaryExpr) (string, error)
- func (g PythonExprGenerator) GenerateUnopExpr(expr *definition.UnopExpr) (string, error)
- func (g PythonExprGenerator) GenerateValueExpr(expr *definition.ValueExpr) (string, error)
- type PythonGenerator
- func (g *PythonGenerator) Generate(ctx *gen.GenCtx) (retErr error, retWarnings error)
- func (g PythonGenerator) GenerateArray(array *definition.Array) (string, error)
- func (g PythonGenerator) GenerateArrayDefaultValue(array *definition.Array) (string, error)
- func (g PythonGenerator) GenerateBasicType(type_ *definition.BasicType) (string, error)
- func (g PythonGenerator) GenerateBasicTypeDefaultValue(type_ *definition.BasicType) (string, error)
- func (g PythonGenerator) GenerateBytes(bytes *definition.Bytes) (string, error)
- func (g PythonGenerator) GenerateBytesDefaultValue(bytes *definition.Bytes) (string, error)
- func (g PythonGenerator) GenerateConstantField(field *definition.ConstantField) (string, error)
- func (g PythonGenerator) GenerateCustomGetter(method *definition.GetMethod) (string, error)
- func (g PythonGenerator) GenerateCustomGetterDecl(method *definition.GetMethod) (string, error)
- func (g PythonGenerator) GenerateCustomSetter(method *definition.SetMethod) (string, error)
- func (g PythonGenerator) GenerateCustomSetterDecl(method *definition.SetMethod) (string, error)
- func (g PythonGenerator) GenerateDecoder(structDef *definition.Struct) (string, error)
- func (g PythonGenerator) GenerateDefaultGetter(method *definition.GetMethod) (string, error)
- func (g PythonGenerator) GenerateDefaultGetterDecl(method *definition.GetMethod) (string, error)
- func (g PythonGenerator) GenerateDefaultSetter(method *definition.SetMethod) (string, error)
- func (g PythonGenerator) GenerateDefaultSetterDecl(method *definition.SetMethod) (string, error)
- func (g PythonGenerator) GenerateEmbeddedField(field *definition.EmbeddedField) (string, error)
- func (g PythonGenerator) GenerateEncoder(structDef *definition.Struct) (string, error)
- func (g PythonGenerator) GenerateEnum(enumDef *definition.Enum) (string, error)
- func (g PythonGenerator) GenerateEnumDefaultValue(enumDef *definition.Enum) (string, error)
- func (g PythonGenerator) GenerateExpr(expr definition.Expr, valueStr string) (string, error)
- func (g PythonGenerator) GenerateField(field definition.Field) (string, error)
- func (g PythonGenerator) GenerateMethod(method definition.Method) (string, error)
- func (g PythonGenerator) GenerateMethodDecl(method definition.Method) (string, error)
- func (g PythonGenerator) GenerateNormalField(field *definition.NormalField) (string, error)
- func (g PythonGenerator) GenerateRawGetter(field definition.Field) (string, error)
- func (g PythonGenerator) GenerateRawGetterDecl(field definition.Field) (string, error)
- func (g PythonGenerator) GenerateRawSetter(field definition.Field) (string, error)
- func (g PythonGenerator) GenerateRawSetterDecl(field definition.Field) (string, error)
- func (g PythonGenerator) GenerateString(string_ *definition.String) (string, error)
- func (g PythonGenerator) GenerateStringDefaultValue(string_ *definition.String) (string, error)
- func (g PythonGenerator) GenerateStruct(structDef *definition.Struct) (string, error)
- func (g PythonGenerator) GenerateStructDefaultValue(structDef *definition.Struct) (string, error)
- func (g PythonGenerator) GenerateType(type_ definition.Type) (string, error)
- func (g PythonGenerator) GenerateTypeDefaultValue(type_ definition.Type) (string, error)
- func (g PythonGenerator) GenerateUnit(unit *definition.CompilationUnit) error
- func (g PythonGenerator) GenerateVoidField(field *definition.VoidField) (string, error)
- type PythonLiteralGenerator
- func (g PythonLiteralGenerator) GenerateBoolLiteral(literal *definition.BoolLiteral) (string, error)
- func (g PythonLiteralGenerator) GenerateFloatLiteral(literal *definition.FloatLiteral) (string, error)
- func (g PythonLiteralGenerator) GenerateIntLiteral(literal *definition.IntLiteral) (string, error)
- func (g PythonLiteralGenerator) GenerateLiteral(literal definition.Literal) (string, error)
- func (g PythonLiteralGenerator) GenerateStringLiteral(literal *definition.StringLiteral) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeneratedType ¶
type GeneratedType struct {
GeneratedDef string
}
type PythonExprGenerator ¶ added in v0.4.0
type PythonExprGenerator struct { *gen.GenExprDispatcher GenType func(definition.Type) (string, error) ValueStr string LiteralGenerator gen.LiteralGeneratorImpl // optional }
func NewPythonExprGenerator ¶ added in v0.4.0
func NewPythonExprGenerator(genType func(definition.Type) (string, error), valueStr string) *PythonExprGenerator
func (PythonExprGenerator) GenerateBinopExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateBinopExpr(expr *definition.BinopExpr) (string, error)
func (PythonExprGenerator) GenerateCastExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateCastExpr(expr *definition.CastExpr) (string, error)
func (PythonExprGenerator) GenerateConstantExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateConstantExpr(expr *definition.ConstantExpr) (string, error)
func (PythonExprGenerator) GenerateExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateExpr(expr definition.Expr) (string, error)
func (PythonExprGenerator) GenerateRawExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateRawExpr(expr *definition.RawExpr) (string, error)
func (PythonExprGenerator) GenerateTenaryExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateTenaryExpr(expr *definition.TenaryExpr) (string, error)
func (PythonExprGenerator) GenerateUnopExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateUnopExpr(expr *definition.UnopExpr) (string, error)
func (PythonExprGenerator) GenerateValueExpr ¶ added in v0.4.0
func (g PythonExprGenerator) GenerateValueExpr(expr *definition.ValueExpr) (string, error)
type PythonGenerator ¶
type PythonGenerator struct { *gen.GenDispatcher GenCtx *gen.GenCtx GenTypes *util.OrderedMap[string, *GeneratedType] GenStack *util.OrderedMap[string, any] Warning definition.TopLevelWarning }
func NewPythonGenerator ¶
func NewPythonGenerator() *PythonGenerator
func (*PythonGenerator) Generate ¶
func (g *PythonGenerator) Generate(ctx *gen.GenCtx) (retErr error, retWarnings error)
func (PythonGenerator) GenerateArray ¶ added in v0.4.0
func (g PythonGenerator) GenerateArray(array *definition.Array) (string, error)
func (PythonGenerator) GenerateArrayDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateArrayDefaultValue(array *definition.Array) (string, error)
func (PythonGenerator) GenerateBasicType ¶ added in v0.4.0
func (g PythonGenerator) GenerateBasicType(type_ *definition.BasicType) (string, error)
func (PythonGenerator) GenerateBasicTypeDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateBasicTypeDefaultValue(type_ *definition.BasicType) (string, error)
func (PythonGenerator) GenerateBytes ¶ added in v0.4.0
func (g PythonGenerator) GenerateBytes(bytes *definition.Bytes) (string, error)
func (PythonGenerator) GenerateBytesDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateBytesDefaultValue(bytes *definition.Bytes) (string, error)
func (PythonGenerator) GenerateConstantField ¶ added in v0.4.0
func (g PythonGenerator) GenerateConstantField(field *definition.ConstantField) (string, error)
func (PythonGenerator) GenerateCustomGetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateCustomGetter(method *definition.GetMethod) (string, error)
func (PythonGenerator) GenerateCustomGetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateCustomGetterDecl(method *definition.GetMethod) (string, error)
func (PythonGenerator) GenerateCustomSetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateCustomSetter(method *definition.SetMethod) (string, error)
func (PythonGenerator) GenerateCustomSetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateCustomSetterDecl(method *definition.SetMethod) (string, error)
func (PythonGenerator) GenerateDecoder ¶ added in v0.4.0
func (g PythonGenerator) GenerateDecoder(structDef *definition.Struct) (string, error)
func (PythonGenerator) GenerateDefaultGetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateDefaultGetter(method *definition.GetMethod) (string, error)
func (PythonGenerator) GenerateDefaultGetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateDefaultGetterDecl(method *definition.GetMethod) (string, error)
func (PythonGenerator) GenerateDefaultSetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateDefaultSetter(method *definition.SetMethod) (string, error)
func (PythonGenerator) GenerateDefaultSetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateDefaultSetterDecl(method *definition.SetMethod) (string, error)
func (PythonGenerator) GenerateEmbeddedField ¶ added in v0.4.0
func (g PythonGenerator) GenerateEmbeddedField(field *definition.EmbeddedField) (string, error)
func (PythonGenerator) GenerateEncoder ¶ added in v0.4.0
func (g PythonGenerator) GenerateEncoder(structDef *definition.Struct) (string, error)
func (PythonGenerator) GenerateEnum ¶ added in v0.4.0
func (g PythonGenerator) GenerateEnum(enumDef *definition.Enum) (string, error)
func (PythonGenerator) GenerateEnumDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateEnumDefaultValue(enumDef *definition.Enum) (string, error)
func (PythonGenerator) GenerateExpr ¶ added in v0.4.0
func (g PythonGenerator) GenerateExpr(expr definition.Expr, valueStr string) (string, error)
func (PythonGenerator) GenerateField ¶ added in v0.4.0
func (g PythonGenerator) GenerateField(field definition.Field) (string, error)
func (PythonGenerator) GenerateMethod ¶ added in v0.4.0
func (g PythonGenerator) GenerateMethod(method definition.Method) (string, error)
func (PythonGenerator) GenerateMethodDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateMethodDecl(method definition.Method) (string, error)
func (PythonGenerator) GenerateNormalField ¶ added in v0.4.0
func (g PythonGenerator) GenerateNormalField(field *definition.NormalField) (string, error)
func (PythonGenerator) GenerateRawGetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateRawGetter(field definition.Field) (string, error)
func (PythonGenerator) GenerateRawGetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateRawGetterDecl(field definition.Field) (string, error)
func (PythonGenerator) GenerateRawSetter ¶ added in v0.4.0
func (g PythonGenerator) GenerateRawSetter(field definition.Field) (string, error)
func (PythonGenerator) GenerateRawSetterDecl ¶ added in v0.4.0
func (g PythonGenerator) GenerateRawSetterDecl(field definition.Field) (string, error)
func (PythonGenerator) GenerateString ¶ added in v0.4.0
func (g PythonGenerator) GenerateString(string_ *definition.String) (string, error)
func (PythonGenerator) GenerateStringDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateStringDefaultValue(string_ *definition.String) (string, error)
func (PythonGenerator) GenerateStruct ¶ added in v0.4.0
func (g PythonGenerator) GenerateStruct(structDef *definition.Struct) (string, error)
func (PythonGenerator) GenerateStructDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateStructDefaultValue(structDef *definition.Struct) (string, error)
func (PythonGenerator) GenerateType ¶ added in v0.4.0
func (g PythonGenerator) GenerateType(type_ definition.Type) (string, error)
func (PythonGenerator) GenerateTypeDefaultValue ¶ added in v0.4.0
func (g PythonGenerator) GenerateTypeDefaultValue(type_ definition.Type) (string, error)
func (PythonGenerator) GenerateUnit ¶ added in v0.4.0
func (g PythonGenerator) GenerateUnit(unit *definition.CompilationUnit) error
func (PythonGenerator) GenerateVoidField ¶ added in v0.4.0
func (g PythonGenerator) GenerateVoidField(field *definition.VoidField) (string, error)
type PythonLiteralGenerator ¶ added in v0.4.0
type PythonLiteralGenerator struct {
*gen.GenLiteralDispatcher
}
func NewPythonLiteralGenerator ¶ added in v0.4.0
func NewPythonLiteralGenerator() *PythonLiteralGenerator
func (PythonLiteralGenerator) GenerateBoolLiteral ¶ added in v0.4.0
func (g PythonLiteralGenerator) GenerateBoolLiteral(literal *definition.BoolLiteral) (string, error)
func (PythonLiteralGenerator) GenerateFloatLiteral ¶ added in v0.4.0
func (g PythonLiteralGenerator) GenerateFloatLiteral(literal *definition.FloatLiteral) (string, error)
func (PythonLiteralGenerator) GenerateIntLiteral ¶ added in v0.4.0
func (g PythonLiteralGenerator) GenerateIntLiteral(literal *definition.IntLiteral) (string, error)
func (PythonLiteralGenerator) GenerateLiteral ¶ added in v0.4.0
func (g PythonLiteralGenerator) GenerateLiteral(literal definition.Literal) (string, error)
func (PythonLiteralGenerator) GenerateStringLiteral ¶ added in v0.4.0
func (g PythonLiteralGenerator) GenerateStringLiteral(literal *definition.StringLiteral) (string, error)
Click to show internal directories.
Click to hide internal directories.