Documentation ¶
Index ¶
- type AssignStatement
- type Builder
- type CallStatement
- type ChainBuilder
- type ChainStatement
- type DeclAssignStatement
- type DeclStatement
- type FunctionBody
- type FunctionBuilder
- type Identifier
- type IfBlock
- type Implementer
- type MapPair
- type MapStatement
- type MethodBuilder
- type MethodReceiver
- type RawBlock
- type RawStatement
- type ReturnStatement
- type SliceStatement
- type Statement
- type StatementList
- type StructBuilder
- type StructFieldPair
- type StructStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignStatement ¶
type AssignStatement struct { Vars []string Values StatementList }
func (AssignStatement) CodeLines ¶
func (stmt AssignStatement) CodeLines() []string
type Builder ¶
type Builder struct { // Program defines generator program name in the generated file. Program string // PackageName defines the package name of the generated file. PackageName string // Imports defines necessary imports to reduce ambiguity when generating // formatting the raw-generated code. Imports [][]code.Import // contains filtered or unexported fields }
func NewBuilder ¶
NewBuilder is a constructor of Builder struct.
func (*Builder) AddImplementer ¶
func (b *Builder) AddImplementer(implementer Implementer)
AddImplementer appends a new implemeneter to the implementer list.
type CallStatement ¶
type CallStatement struct { FuncName string Params StatementList }
func (CallStatement) CodeLines ¶
func (stmt CallStatement) CodeLines() []string
type ChainBuilder ¶
type ChainBuilder []Statement
func NewChainBuilder ¶
func NewChainBuilder(object string) ChainBuilder
func (ChainBuilder) Build ¶
func (b ChainBuilder) Build() ChainStatement
func (ChainBuilder) Call ¶
func (b ChainBuilder) Call(method string, params ...Statement) ChainBuilder
func (ChainBuilder) Chain ¶
func (b ChainBuilder) Chain(field string) ChainBuilder
type ChainStatement ¶
type ChainStatement []Statement
func (ChainStatement) CodeLines ¶
func (stmt ChainStatement) CodeLines() []string
type DeclAssignStatement ¶
type DeclAssignStatement struct { Vars []string Values StatementList }
func (DeclAssignStatement) CodeLines ¶
func (stmt DeclAssignStatement) CodeLines() []string
type DeclStatement ¶
func (DeclStatement) CodeLines ¶
func (stmt DeclStatement) CodeLines() []string
type FunctionBody ¶
type FunctionBody []Statement
func (FunctionBody) Code ¶
func (b FunctionBody) Code() string
type FunctionBuilder ¶
type FunctionBuilder struct { Name string Params []code.Param Returns []code.Type Body FunctionBody }
FunctionBuilder is an implementer of a function.
func (FunctionBuilder) GenParams ¶
func (fb FunctionBuilder) GenParams() string
func (FunctionBuilder) GenReturns ¶
func (fb FunctionBuilder) GenReturns() string
type Identifier ¶
type Identifier string
func (Identifier) CodeLines ¶
func (id Identifier) CodeLines() []string
type Implementer ¶
Implementer is an interface that wraps the basic Impl method for code generation.
type MapPair ¶
func (MapPair) ItemCodeLines ¶
type MapStatement ¶
func (MapStatement) CodeLines ¶
func (stmt MapStatement) CodeLines() []string
type MethodBuilder ¶
type MethodBuilder struct { Receiver MethodReceiver Name string Params []code.Param Returns []code.Type Body FunctionBody }
MethodBuilder is an implementer of a method.
func (MethodBuilder) GenParams ¶
func (mb MethodBuilder) GenParams() string
func (MethodBuilder) GenReceiver ¶
func (mb MethodBuilder) GenReceiver() string
func (MethodBuilder) GenReturns ¶
func (mb MethodBuilder) GenReturns() string
type MethodReceiver ¶
type MethodReceiver struct { Name string Type code.SimpleType Pointer bool }
MethodReceiver describes a specification of a method receiver.
type RawStatement ¶
type RawStatement string
func (RawStatement) CodeLines ¶
func (stmt RawStatement) CodeLines() []string
type ReturnStatement ¶
type ReturnStatement StatementList
func (ReturnStatement) CodeLines ¶
func (stmt ReturnStatement) CodeLines() []string
type SliceStatement ¶
func (SliceStatement) CodeLines ¶
func (stmt SliceStatement) CodeLines() []string
type StatementList ¶
type StatementList []Statement
func (StatementList) CodeLines ¶
func (l StatementList) CodeLines() []string
type StructBuilder ¶
type StructBuilder struct { Name string Fields code.StructFields }
StructBuilder is an implementer of a struct.
func (StructBuilder) GenFields ¶
func (sb StructBuilder) GenFields() string
type StructFieldPair ¶
func (StructFieldPair) ItemCodeLines ¶
func (p StructFieldPair) ItemCodeLines() []string
type StructStatement ¶
type StructStatement struct { Type string Pairs []StructFieldPair }
func (StructStatement) CodeLines ¶
func (stmt StructStatement) CodeLines() []string
Click to show internal directories.
Click to hide internal directories.