func VarName(name NameDeclr) VariableNameDeclr {
	return VariableNameDeclr{
		Name: name,
	}
}
VarName returns a new instance of a VariableNameDeclr.
package gen
import (
	"bytes"
	"fmt"
	"io"
	"text/template"
)
func RuneASCII(rn rune) RuneASCIIDeclr {
	return RuneASCIIDeclr{
		Value: rn,
	}
}
func RuneGraphics(rn rune) RuneGraphicsDeclr {
	return RuneGraphicsDeclr{
		Value: rn,
	}
}
func Rune(rn rune) RuneDeclr {
	return RuneDeclr{
		Value: rn,
	}
}
func StringASCII(rn string) StringASCIIDeclr {
	return StringASCIIDeclr{
		Value: rn,
	}
}
func Bool(rn bool) BoolDeclr {
	return BoolDeclr{
		Value: rn,
	}
}
func FloatBase(rn float64, bit, prec int) FloatBaseDeclr {
	return FloatBaseDeclr{
		Value:     rn,
		Bitsize:   bit,
		Precision: prec,
	}
}
func Float32(rn float32) Float32Declr {
	return Float32Declr{
		Value: rn,
	}
}
func Float64(rn float64) Float64Declr {
	return Float64Declr{
		Value: rn,
	}
}
func IntBase(rn int64, base int) IntBaseDeclr {
	return IntBaseDeclr{
		Value: rn,
		Base:  base,
	}
}
func Int32(rn int32) Int32Declr {
	return Int32Declr{
		Value: rn,
	}
}
func Int64(rn int64) Int64Declr {
	return Int64Declr{
		Value: rn,
	}
}
func Int(rn int) IntDeclr {
	return IntDeclr{
		Value: rn,
	}
}
func UIntBase(rn uint64, base int) UIntBaseDeclr {
	return UIntBaseDeclr{
		Value: rn,
		Base:  base,
	}
}
func UInt32(rn uint32) UInt32Declr {
	return UInt32Declr{
		Value: rn,
	}
}
func UInt64(rn uint64) UInt64Declr {
	return UInt64Declr{
		Value: rn,
	}
}
func Value(rn interface{}, converter func(interface{}) string) ValueDeclr {
	return ValueDeclr{
		Value:          rn,
		ValueConverter: converter,
	}
}
func Fmt(txt string, fm ...interface{}) io.WriterTo {
	return TextBlockDeclr{
		Text: fmt.Sprintf(txt, fm...),
	}
}
func JSON(documents ...io.WriterTo) JSONDeclr {
	return JSONDeclr{
		Documents: documents,
	}
}
func JSONDocument(contents map[string]io.WriterTo) JSONBlock {
	return JSONBlock{
		Items: contents,
	}
}
func Text(txt string) TextBlockDeclr {
	return TextBlockDeclr{
		Text: txt,
	}
}
func String(rn string) StringDeclr {
	return StringDeclr{
		Value: rn,
	}
}
func Imports(ims ...ImportItemDeclr) ImportDeclr {
	return ImportDeclr{
		Packages: ims,
	}
}
func Import(path string, namespace string) ImportItemDeclr {
	return ImportItemDeclr{
		Namespace: namespace,
		Path:      path,
	}
}
func AssignMap(name string, maptype string, mapvalue string) VariableShortAssignmentDeclr {
	return Var(Name(name), MapValueVar(maptype, mapvalue))
}
func MapVar(name string, maptype string, mapvalue string) VariableTypeDeclr {
	return VarType(Name(name), MapType(maptype, mapvalue))
}
func MapValueVar(mapType string, mapValue string) TypeDeclr {
	return Type(fmt.Sprintf("map[%s]%s{}", mapType, mapValue))
}
func CustomMapValueVar(mapdefType, mapType string, mapValue string) TypeDeclr {
	return Type(fmt.Sprintf("%s[%s]%s{}", mapdefType, mapType, mapValue))
}
func MapType(maptype string, mapvalue string) TypeDeclr {
	return Type(fmt.Sprintf("map[%s]%s", maptype, mapvalue))
}
func CustomMapType(mapdefType, mapType string, mapValue string) TypeDeclr {
	return Type(fmt.Sprintf("%s[%s]%s", mapdefType, mapType, mapValue))
}
func Map(mapkeyType string, mapkeyValue string, values map[string]io.WriterTo) MapDeclr {
	return TMap("map", mapkeyType, mapkeyValue, values)
}
func TMap(mapType string, mapkeyType string, mapkeyValue string, values map[string]io.WriterTo) MapDeclr {
	return MapDeclr{
		Values:  values,
		MapType: Name(mapType),
		Type:    Name(mapkeyType),
		Value:   Name(mapkeyValue),
	}
}
func Type(name string) TypeDeclr {
	return TypeDeclr{
		TypeName: name,
	}
}
func FmtName(name string, vals ...interface{}) NameDeclr {
	return NameDeclr{
		Name: fmt.Sprintf(name, vals...),
	}
}
func Name(name string) NameDeclr {
	return NameDeclr{
		Name: name,
	}
}
func Package(name io.WriterTo, dirs ...io.WriterTo) PackageDeclr {
	return PackageDeclr{
		Name: name,
		Body: dirs,
	}
}
func CustomReturns(returns ...io.WriterTo) CustomReturnDeclr {
	return CustomReturnDeclr{
		Returns: returns,
	}
}
func Returns(returns ...TypeDeclr) ReturnDeclr {
	return ReturnDeclr{
		Returns: returns,
	}
}
func Constructor(args ...VariableTypeDeclr) ConstructorDeclr {
	return ConstructorDeclr{
		Arguments: args,
	}
}
func Interface(name NameDeclr, comments io.WriterTo, annotations io.WriterTo, fields ...io.WriterTo) StructDeclr {
	if annotations == nil {
		annotations = bytes.NewBuffer(nil)
	}
	if comments == nil {
		comments = bytes.NewBuffer(nil)
	}
	return StructDeclr{
		Type:        Type("interface"),
		Name:        name,
		Comments:    comments,
		Annotations: annotations,
		Fields:      fields,
	}
}
func Struct(name NameDeclr, comments io.WriterTo, annotations io.WriterTo, fields ...io.WriterTo) StructDeclr {
	if annotations == nil {
		annotations = bytes.NewBuffer(nil)
	}
	if comments == nil {
		comments = bytes.NewBuffer(nil)
	}
	return StructDeclr{
		Type:        Type("struct"),
		Name:        name,
		Comments:    comments,
		Annotations: annotations,
		Fields:      fields,
	}
}
func Annotations(names ...string) io.WriterTo {
	var decls WritersTo
	for _, name := range names {
		decls = append(decls, Annotation(name))
	}
	return NewlineMapper.Map(decls...)
}
func Annotation(name string) AnnotationDeclr {
	return AnnotationDeclr{
		Value: name,
	}
}
func Tag(format string, name string) TagDeclr {
	return TagDeclr{
		Format: format,
		Name:   name,
	}
}
func Field(name NameDeclr, ntype TypeDeclr, tags ...io.WriterTo) StructTypeDeclr {
	return StructTypeDeclr{
		Name: name,
		Type: ntype,
		Tags: tags,
	}
}
func FunctionType(name NameDeclr, constr ConstructorDeclr, returns io.WriterTo) FunctionTypeDeclr {
	return FunctionTypeDeclr{
		Name:        name,
		Constructor: constr,
		Returns:     returns,
	}
}
func Function(name NameDeclr, constr ConstructorDeclr, returns io.WriterTo, body ...io.WriterTo) FunctionDeclr {
	return FunctionDeclr{
		Name:        name,
		Constructor: constr,
		Returns:     returns,
		Body:        body,
	}
}
func SourceWith(tml *template.Template, dfns template.FuncMap, binding interface{}) SourceDeclr {
	return SourceDeclr{
		Template: tml.Funcs(defaultFuncs).Funcs(dfns),
		Binding:  binding,
	}
}
func Source(tml *template.Template, binding interface{}) SourceDeclr {
	return SourceDeclr{
		Template: tml.Funcs(defaultFuncs),
		Binding:  binding,
	}
}
func SourceTextWith(tml string, funcs template.FuncMap, binding interface{}) TextDeclr {
	return TextDeclr{
		Name:     "source:template",
		Funcs:    funcs,
		Template: tml,
		Binding:  binding,
	}
}
func SourceTextWithName(name string, tml string, funcs template.FuncMap, binding interface{}) TextDeclr {
	return TextDeclr{
		Name:     name,
		Funcs:    funcs,
		Template: tml,
		Binding:  binding,
	}
}
func SourceText(tml string, binding interface{}) TextDeclr {
	return TextDeclr{
		Template: tml,
		Binding:  binding,
	}
}
func PrefixByte(start []byte) SingleByteBlockDeclr {
	return SingleByteBlockDeclr{
		Block: start,
	}
}
func SuffixByte(end []byte) SingleByteBlockDeclr {
	return SingleByteBlockDeclr{
		Block: end,
	}
}
func PrefixRune(start rune) SingleBlockDeclr {
	return SingleBlockDeclr{
		Rune: start,
	}
}
func SuffixRune(end rune) SingleBlockDeclr {
	return SingleBlockDeclr{
		Rune: end,
	}
}
func Prefix(prefix, val io.WriterTo) PrefixDeclr {
	return PrefixDeclr{
		Prefix: prefix,
		Value:  val,
	}
}
func Suffix(suffix, val io.WriterTo) SuffixDeclr {
	return SuffixDeclr{
		Suffix: suffix,
		Value:  val,
	}
}
func MultiCommentary(mainblock io.WriterTo, elems ...io.WriterTo) MultiCommentDeclr {
	return MultiCommentDeclr{
		MainBlock: mainblock,
		Blocks:    WritersTo(elems),
	}
}
func Commentary(mainblock io.WriterTo, elems ...io.WriterTo) CommentDeclr {
	return CommentDeclr{
		MainBlock: mainblock,
		Blocks:    WritersTo(elems),
	}
}
func Block(elems ...io.WriterTo) BlockDeclr {
	return BlockDeclr{
		Block: WritersTo(elems),
	}
}
func WrapBlock(begin, end rune, elems ...io.WriterTo) BlockDeclr {
	return BlockDeclr{
		RuneBegin: begin,
		RuneEnd:   end,
		Block:     WritersTo(elems),
	}
}
func ByteWrapBlock(begin, end []byte, elems ...io.WriterTo) ByteBlockDeclr {
	return ByteBlockDeclr{
		BlockBegin: begin,
		BlockEnd:   end,
		Block:      WritersTo(elems),
	}
}
func Switch(condition io.WriterTo, def DefaultCaseDeclr, cases ...CaseDeclr) SwitchDeclr {
	if def.Behaviour == nil {
		def.Behaviour = bytes.NewBuffer(nil)
	}
	return SwitchDeclr{
		Default:   def,
		Cases:     cases,
		Condition: condition,
	}
}
func DefaultCase(action io.WriterTo) DefaultCaseDeclr {
	return DefaultCaseDeclr{
		Behaviour: action,
	}
}
func Case(condition, action io.WriterTo) CaseDeclr {
	return CaseDeclr{
		Condition: condition,
		Behaviour: action,
	}
}
func Condition(pre VariableNameDeclr, op OperatorDeclr, post VariableNameDeclr) ConditionDeclr {
	return ConditionDeclr{
		PreVar:   pre,
		PostVar:  post,
		Operator: op,
	}
}
func Var(name NameDeclr, value io.WriterTo) VariableShortAssignmentDeclr {
	return VariableShortAssignmentDeclr{
		Name:  name,
		Value: value,
	}
}
func AssignVar(name NameDeclr, value io.WriterTo) VariableAssignmentDeclr {
	return VariableAssignmentDeclr{
		Name:  name,
		Value: value,
	}
}
func MapAssignValue(mapname string, key string, value string) ValueAssignmentDeclr {
	return AssignValue(Name(fmt.Sprintf("%s[%s]", mapname, key)), Name(fmt.Sprintf("%s", value)))
}
func AssignValue(name NameDeclr, value io.WriterTo) ValueAssignmentDeclr {
	return ValueAssignmentDeclr{
		Name:  name,
		Value: value,
	}
}