Documentation
¶
Index ¶
- Variables
- func AddTypedef(n string, tp *Type)
- func GoToC(sname, name string, pnames, snames []string, rtype *Type, ptypes []*Type, ...) string
- func IsGoInterface(gt string) bool
- func PtrIsGoInterface(gt string) bool
- func PtrShouldWrap(gt string) bool
- func SetSuper(c, p string)
- func SetTypeParam(c, n, t string)
- func ShouldWrap(gt string) bool
- func Super(c string) string
- func TypedefShouldWrap(gt string) bool
- func Wrap(s string)
- type Node
- func APIAvailable(s string, n *Node) (string, *Node)
- func APIDeprecated(s string, n *Node) (string, *Node)
- func APIDeprecatedWithReplacement(s string, n *Node) (string, *Node)
- func APIUnavailable(s string, n *Node) (string, *Node)
- func AbstractDeclarator(s string, n *Node) (string, *Node)
- func ArrayDeclarator(s string, n *Node) (string, *Node)
- func Attr(s string, n *Node) (string, *Node)
- func Attribute(s string, n *Node) (string, *Node)
- func BareTypedefName(s string, n *Node) (string, *Node)
- func Block(s string, n *Node) (string, *Node)
- func DeclarationSpecifiers(s string, n *Node) (string, *Node)
- func Declarator(s string, n *Node) (string, *Node)
- func DirectAbstractDeclarator(s string, n *Node) (string, *Node)
- func DirectDeclarator(s string, n *Node) (string, *Node)
- func DispatchReturns(s string, n *Node) (string, *Node)
- func EnumSpecifier(s string, n *Node) (string, *Node)
- func FirstMethodParameter(s string, n *Node) (string, *Node)
- func FunctionDeclarator(s string, n *Node) (string, *Node)
- func Generic(s string, n *Node) (string, *Node)
- func GenericList(s string, n *Node) (string, *Node)
- func Identifier(s string, n *Node) (string, *Node)
- func MethodParameter(s string, n *Node) (string, *Node)
- func MethodParameterList(s string, n *Node) (string, *Node)
- func MethodSignature(s string, n *Node) (string, *Node)
- func NSAvailable(s string, n *Node) (string, *Node)
- func NSAvailableMac(s string, n *Node) (string, *Node)
- func NSDeprecated(s string, n *Node) (string, *Node)
- func NewNode(k string, cs ...string) *Node
- func NullableAnnotation(s string, n *Node) (string, *Node)
- func ParameterDeclaration(s string, n *Node) (string, *Node)
- func ParameterList(s string, n *Node) (string, *Node)
- func ParenAbstractDeclarator(s string, n *Node) (string, *Node)
- func Parse(s string) (*Node, error)
- func Pointer(s string, n *Node) (string, *Node)
- func ReturnsInnerPointer(s string, n *Node) (string, *Node)
- func SpecifierQualifierList(s string, n *Node) (string, *Node)
- func StorageClassSpecifier(s string, n *Node) (string, *Node)
- func StructOrUnion(s string, n *Node) (string, *Node)
- func StructOrUnionSpecifier(s string, n *Node) (string, *Node)
- func SwiftUnavailable(s string, n *Node) (string, *Node)
- func TypeQualifier(s string, n *Node) (string, *Node)
- func TypeQualifierList(s string, n *Node) (string, *Node)
- func TypeSpecifier(s string, n *Node) (string, *Node)
- func TypedefName(s string, n *Node) (string, *Node)
- func (n *Node) AddChild(c *Node) *Node
- func (n *Node) Annotations() string
- func (n *Node) ArrayOf() *Node
- func (n *Node) BaseType() *Node
- func (n *Node) CType() string
- func (n *Node) CTypeSimplified() string
- func (n *Node) HasFunc() bool
- func (n *Node) IsArray() bool
- func (n *Node) IsFunction() bool
- func (n *Node) IsId() bool
- func (n *Node) IsInstancetype() bool
- func (n *Node) IsPointer() bool
- func (n *Node) IsStruct() bool
- func (n *Node) PointsTo() *Node
- func (n *Node) Qualifiers() string
- func (n *Node) ReturnType() *Node
- func (n *Node) String(ls ...int) string
- type Parser
- func AngBracketed(p Parser) Parser
- func Bracketed(p Parser) Parser
- func ChildOf(ret *Node, p Parser) Parser
- func Children(ps ...Parser) Parser
- func ChildrenOf(ret *Node, p Parser) Parser
- func CurlyBracketed(p Parser) Parser
- func Lit(f string, ws ...bool) Parser
- func Nest(ps ...Parser) Parser
- func NodeNamed(k string, p Parser) Parser
- func OneOf(ps ...Parser) Parser
- func OneOrMore(p Parser) Parser
- func Opt(p Parser) Parser
- func Parenthesized(p Parser) Parser
- func Regexp(f string) Parser
- func Seq(ps ...Parser) Parser
- func Word(f string) Parser
- func ZeroOrMore(p Parser) Parser
- type Type
- func (t *Type) BaseType() *Type
- func (t *Type) CGoType() string
- func (t *Type) CToGo(cval string) string
- func (t *Type) CType() string
- func (t *Type) CTypeAttrib() string
- func (t *Type) CloneToClass(c string) *Type
- func (t *Type) GoInterfaceDecl(fin bool) string
- func (t *Type) GoType() string
- func (t *Type) GoTypeDecl(fin bool) string
- func (t *Type) IsFunction() bool
- func (t *Type) IsFunctionPtr() bool
- func (t *Type) IsPointer() bool
- func (t *Type) IsValist() bool
- func (t *Type) PointsTo() *Type
- func (t *Type) ReturnType() *Type
- func (t *Type) String() string
- func (t *Type) Typedef() *Type
Constants ¶
This section is empty.
Variables ¶
var (
Debug bool = false
)
var Gogc bool
var TypeName func(s string, n *Node) (string, *Node)
var TypeParameters map[string]map[string]string
TypeParameters maps, for each class, a TypedefName to a type, representing the Objective-C type parameters for that class
var Typesubs map[string]string
Functions ¶
func AddTypedef ¶
func GoToC ¶
func GoToC(sname, name string, pnames, snames []string, rtype *Type, ptypes []*Type, fun, fin bool, cm bool, goImports map[string]bool) string
Call a C function from Go with a given return type and parameter types
func IsGoInterface ¶
func PtrIsGoInterface ¶
func PtrShouldWrap ¶
func SetTypeParam ¶
func SetTypeParam(c, n, t string)
func ShouldWrap ¶
func TypedefShouldWrap ¶
Types ¶
type Node ¶
func NewNode ¶
NewNode returns a new node of kind k with an optional content string as its second parameter.
func (*Node) Annotations ¶
func (*Node) ArrayOf ¶
ArrayOf, when called on an array node returns a node describing the type of the elements of the array. Otherwise returns nil when called on non-array types.
func (*Node) CTypeSimplified ¶
func (*Node) IsFunction ¶
func (*Node) IsInstancetype ¶
func (*Node) PointsTo ¶
PointsTo, when called on a pointer node returns a node describing the type pointed to. Otherwise returns nil when called on non-pointer types.
func (*Node) Qualifiers ¶
func (*Node) ReturnType ¶
type Parser ¶
Parser is a function that takes the string to be parsed plus an input Node and returns a new Node and the unparsed remainder string. If the parser fails to parse anything in the input, it should return a nil Node.
func AngBracketed ¶
AngBracketed matches the input parser surrounded by literal angled brackets.
func Children ¶
Children takes a parser and returns a parser that adds the children of its output node to the tree. If multiple parsers are passed in, they are passed to Seq(...)
func ChildrenOf ¶
ChildrenOf takes a node and adds the children of a parser's output node to it as its children.
func CurlyBracketed ¶
CurlyBracketed matches the input parser surrounded by literal curly brackets.
func OneOrMore ¶
OneOrMore is ZeroOrMore, but fails (returns nil) if the input parser does not match any elements.
func Parenthesized ¶
Parenthesized matches the input parser surrounded by literal parenthesis.
func Seq ¶
Seq applies parsers in sequence, adding results as children to the input node. Returns nil and the input string unless the entire sequence succeeds
func ZeroOrMore ¶
ZeroOrMore returns a sequence of zero or more nodes