nswrap/wrap/main.go

30 lines
535 B
Go
Raw Normal View History

2019-04-09 11:52:21 -04:00
package wrap
import (
"fmt"
"reflect"
"gitlab.wow.st/gmp/clast/ast"
)
type Wrapper struct {
}
func NewWrapper() *Wrapper {
return &Wrapper{}
}
func (w *Wrapper) Wrap(n *ast.ObjCInterfaceDecl) {
fmt.Println("//generated by gitlab.wow.st/gmp/clast")
for _,c := range n.Children() {
switch x := c.(type) {
case *ast.Unknown:
fmt.Printf("%s: %s\n",x.Name,x.Content)
case *ast.ObjCMethodDecl:
fmt.Printf("*ast.ObjCMethodDecl: %s (%s %s)\n",x.Name,x.Type, x.Attr)
default:
fmt.Println(reflect.TypeOf(x))
}
}
}