30 lines
535 B
Go
30 lines
535 B
Go
|
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))
|
||
|
}
|
||
|
}
|
||
|
}
|