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