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