Documentation ¶
Index ¶
- func NewCommand(cfg *Config, namerCfg *NamerConfig) *cli.Command
- type CodeTransformerBackend
- type CodeTransformerBackendPresenterCpp
- type CodeTransformerFrontend
- type CodeTransformerFrontendGo
- func (inst *CodeTransformerFrontendGo) AddFile(fset *token.FileSet, file *ast.File, resolver TypeResolver, i int, nFiles int, ...) (err error)
- func (inst *CodeTransformerFrontendGo) Emit(out io.Writer) (n int, err error)
- func (inst *CodeTransformerFrontendGo) NextFuncProcIdOffset() uint32
- func (inst *CodeTransformerFrontendGo) Reset()
- type Config
- type Emitter
- type IDLDriver
- type IDLDriverGoFile
- func (inst *IDLDriverGoFile) DriveBackend(generator CodeTransformerBackend) (err error)
- func (inst *IDLDriverGoFile) DriveFrontend(generator CodeTransformerFrontend) (err error)
- func (inst *IDLDriverGoFile) FuncDeclToId(decl *ast.FuncDecl) runtime.FuncProcId
- func (inst *IDLDriverGoFile) ResolveBasicType(expr ast.Expr) (typeName string, castType string, err error)
- type IdResolver
- type Namer
- func (inst *Namer) GoTypeNameToCppTypeName(name string) (r string, err error)
- func (inst *Namer) GoTypeNameToRecvExprCpp(name string) (r string, err error)
- func (inst *Namer) GoTypeNameToSendExprCpp(name string, varname string) (r string, err error)
- func (inst *Namer) GoTypeNameToSendRecvFuncNameSuffix(name string) (r string, err error)
- type NamerConfig
- type TypeResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
func NewCommand(cfg *Config, namerCfg *NamerConfig) *cli.Command
Types ¶
type CodeTransformerBackend ¶
type CodeTransformerBackend interface { AddFunction(decl *ast.FuncDecl, resolver TypeResolver, id runtime.FuncProcId) (err error) Reset() Emitter }
CodeTransformerBackend generate code for the backend i.e. the library executing the foreign function body (in the foreign programming language)
type CodeTransformerBackendPresenterCpp ¶
type CodeTransformerBackendPresenterCpp struct {
// contains filtered or unexported fields
}
func NewCodeTransformerBackendPresenterCpp ¶
func NewCodeTransformerBackendPresenterCpp(namer *Namer) *CodeTransformerBackendPresenterCpp
func (*CodeTransformerBackendPresenterCpp) AddFunction ¶
func (inst *CodeTransformerBackendPresenterCpp) AddFunction(decl *ast.FuncDecl, resolver TypeResolver, id runtime.FuncProcId) (err error)
func (*CodeTransformerBackendPresenterCpp) Emit ¶
func (inst *CodeTransformerBackendPresenterCpp) Emit(out io.Writer) (n int, err error)
func (*CodeTransformerBackendPresenterCpp) Reset ¶
func (inst *CodeTransformerBackendPresenterCpp) Reset()
type CodeTransformerFrontend ¶
type CodeTransformerFrontend interface { AddFile(fset *token.FileSet, file *ast.File, resolver TypeResolver, i int, nFiles int, idResolver IdResolver) (err error) Reset() Emitter }
CodeTransformerFrontend generate code for the frontend i.e. the library invoking the foreign functions
type CodeTransformerFrontendGo ¶
type CodeTransformerFrontendGo struct {
// contains filtered or unexported fields
}
func NewCodeTransformerFrontendGo ¶
func NewCodeTransformerFrontendGo(namer *Namer, goCodeProlog string) *CodeTransformerFrontendGo
func (*CodeTransformerFrontendGo) AddFile ¶
func (inst *CodeTransformerFrontendGo) AddFile(fset *token.FileSet, file *ast.File, resolver TypeResolver, i int, nFiles int, idResolver IdResolver) (err error)
func (*CodeTransformerFrontendGo) Emit ¶
func (inst *CodeTransformerFrontendGo) Emit(out io.Writer) (n int, err error)
func (*CodeTransformerFrontendGo) NextFuncProcIdOffset ¶
func (inst *CodeTransformerFrontendGo) NextFuncProcIdOffset() uint32
func (*CodeTransformerFrontendGo) Reset ¶
func (inst *CodeTransformerFrontendGo) Reset()
type Config ¶
type Config struct { GoCodeProlog string IdlBuildTag string IdlPackagePattern string GoOutputFile string CppOutputFile string FuncProcIdOffset uint32 // contains filtered or unexported fields }
func (*Config) FromContext ¶
func (*Config) ToCliFlags ¶
func (inst *Config) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag
type IDLDriver ¶
type IDLDriver interface { DriveBackend(generator CodeTransformerBackend) (err error) DriveFrontend(generator CodeTransformerFrontend) (err error) }
IDLDriver convert interface description language to go ast.FuncDecl ast nodes
type IDLDriverGoFile ¶
type IDLDriverGoFile struct {
// contains filtered or unexported fields
}
func NewIDLDriverGoFile ¶
func NewIDLDriverGoFile(idlBuildTag string, packagePattern string, idOffset runtime.FuncProcId) (inst *IDLDriverGoFile, err error)
func (*IDLDriverGoFile) DriveBackend ¶
func (inst *IDLDriverGoFile) DriveBackend(generator CodeTransformerBackend) (err error)
func (*IDLDriverGoFile) DriveFrontend ¶
func (inst *IDLDriverGoFile) DriveFrontend(generator CodeTransformerFrontend) (err error)
func (*IDLDriverGoFile) FuncDeclToId ¶
func (inst *IDLDriverGoFile) FuncDeclToId(decl *ast.FuncDecl) runtime.FuncProcId
func (*IDLDriverGoFile) ResolveBasicType ¶
type IdResolver ¶
type IdResolver interface {
FuncDeclToId(decl *ast.FuncDecl) runtime.FuncProcId
}
type Namer ¶
type Namer struct {
// contains filtered or unexported fields
}
func NewNamer ¶
func NewNamer(cfg *NamerConfig) *Namer
func (*Namer) GoTypeNameToCppTypeName ¶
func (*Namer) GoTypeNameToRecvExprCpp ¶
func (*Namer) GoTypeNameToSendExprCpp ¶
type NamerConfig ¶
type NamerConfig struct { RuneCppType string // contains filtered or unexported fields }
func (*NamerConfig) FromContext ¶
func (inst *NamerConfig) FromContext(nameTransf config.NameTransformFunc, ctx *cli.Context) (nMessages int)
func (*NamerConfig) ToCliFlags ¶
func (inst *NamerConfig) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag
func (*NamerConfig) Validate ¶
func (inst *NamerConfig) Validate(force bool) (nMessages int)
Click to show internal directories.
Click to hide internal directories.