Further construct, add type resolution

This commit is contained in:
Leland Batey 2016-10-09 11:54:16 -07:00
Родитель b2b619e83e
Коммит 2babfa4458
4 изменённых файлов: 277 добавлений и 106 удалений

Просмотреть файл

@ -7,28 +7,29 @@ import (
"go/parser"
"go/token"
"io"
"strings"
"github.com/davecgh/go-spew/spew"
"github.com/pkg/errors"
)
type Catalog struct {
PkgName string
Origin *ast.File
Messages []*Message
Enums []*Enum
ServiceMethods []*ServiceMethod
PkgName string
origin *ast.File
Messages []*Message
Enums []*Enum
Service *Service
}
type Message struct {
Name string
Origin *ast.TypeSpec
origin *ast.TypeSpec
Fields []*Field
}
type Enum struct {
Name string
Origin *ast.TypeSpec
origin *ast.TypeSpec
}
type Map struct {
@ -37,18 +38,26 @@ type Map struct {
Value *FieldType
}
type Service struct {
Name string
Methods []*ServiceMethod
}
type ServiceMethod struct {
Name string
Origin *ast.TypeSpec
Name string
RequestType *FieldType
ResponseType *FieldType
origin *ast.TypeSpec
}
type Field struct {
Name string
Type FieldType
Origin *ast.Field
Type *FieldType
origin *ast.Field
}
type FieldType struct {
// Name will contain the name of the type, for example "string" or "bool"
Name string
Enum *Enum
Message *Message
@ -56,7 +65,7 @@ type FieldType struct {
StarExpr bool
ArrayType bool
// May be one of four types: *ast.MapType, *ast.Ident, *ast.StarExpr, or *ast.ArrayType
Origin ast.Expr
origin ast.Expr
}
func retrieveTypeSpecs(f *ast.File) ([]*ast.TypeSpec, error) {
@ -94,7 +103,7 @@ func New(goFiles []io.Reader, protoFile io.Reader) (*Catalog, error) {
typespecs, _ := retrieveTypeSpecs(fileAst)
for _, t := range typespecs {
//sp.Dump(t)
sp.Dump(t)
switch typdf := t.Type.(type) {
case *ast.Ident:
if typdf.Name == "int32" {
@ -111,13 +120,21 @@ func New(goFiles []io.Reader, protoFile io.Reader) (*Catalog, error) {
}
rv.Messages = append(rv.Messages, nmsg)
case *ast.InterfaceType:
nmeth, err := NewServiceMethod(t)
if err != nil {
return nil, errors.Wrapf(err, "error parsing service method %q", t.Name.Name)
// Each service will have two interfaces ("{SVCNAME}Server" and
// "{SVCNAME}Client") each containing the same information that we
// care about, but structured a bit differently. For simplicity,
// skip the "Client" interface.
if strings.HasSuffix("Client", t.Name.Name) {
break
}
rv.ServiceMethods = append(rv.ServiceMethods, nmeth)
nsvc, err := NewService(t)
if err != nil {
return nil, errors.Wrapf(err, "error parsing service %q", t.Name.Name)
}
rv.Service = nsvc
}
}
resolveTypes(&rv)
sp.Dump(rv)
return &rv, nil
@ -137,7 +154,8 @@ func NewMessage(m *ast.TypeSpec) (*Message, error) {
}
sp := spew.ConfigState{Indent: " "}
sp.Dump(m)
_ = sp
//sp.Dump(m)
strct := m.Type.(*ast.StructType)
for _, f := range strct.Fields.List {
nfield, err := NewField(f)
@ -157,32 +175,110 @@ func NewMap(m *ast.TypeSpec) (*Map, error) {
}, nil
}
func NewServiceMethod(s *ast.TypeSpec) (*ServiceMethod, error) {
return &ServiceMethod{
// NewService returns a new Service struct derived from an *ast.TypeSpec with a
// Type of *ast.InterfaceType.
func NewService(s *ast.TypeSpec) (*Service, error) {
rv := &Service{
Name: s.Name.Name,
//Origin: s,
}, nil
}
asvc := s.Type.(*ast.InterfaceType)
for _, m := range asvc.Methods.List {
nmeth, err := NewServiceMethod(m)
if err != nil {
return nil, errors.Wrapf(err, "Couldn't create service method %q of service %q", m.Names[0].Name, rv.Name)
}
rv.Methods = append(rv.Methods, nmeth)
}
return rv, nil
}
// NewServiceMethod returns a new ServiceMethod derived from the provided
// *ast.Field. The given *ast.Field is intended to have a Type of *ast.FuncType
// from an *ast.InterfaceType's Methods.List attribute. Providing an *ast.Field
// with a different structure may return an error.
func NewServiceMethod(m *ast.Field) (*ServiceMethod, error) {
rv := &ServiceMethod{
Name: m.Names[0].Name,
}
ft, ok := m.Type.(*ast.FuncType)
if !ok {
return nil, errors.New("Provided *ast.Field.Type is not of type *ast.FuncType; cannot proceed")
}
input := ft.Params.List
output := ft.Results.List
// Zero'th param of a serverMethod is Context.context, while first param is
// this methods RequestType
rq := input[1]
rs := output[0]
makeFieldType := func(in *ast.Field) (*FieldType, error) {
star, ok := in.Type.(*ast.StarExpr)
if !ok {
return nil, errors.New("could not create FieldType, in.Type is not *ast.StarExpr")
}
ident, ok := star.X.(*ast.Ident)
if !ok {
return nil, errors.New("could not create FieldType, star.Type is not *ast.Ident")
}
return &FieldType{
Name: ident.Name,
StarExpr: true,
origin: in.Type,
}, nil
}
var err error
rv.RequestType, err = makeFieldType(rq)
if err != nil {
return nil, errors.Wrapf(err, "RequestType creation of service method %q failed", rv.Name)
}
rv.ResponseType, err = makeFieldType(rs)
if err != nil {
return nil, errors.Wrapf(err, "ResponseType creation of service method %q failed", rv.Name)
}
return rv, nil
}
// NewField returns a Field struct with information distilled from an
// *ast.Field. The following is an informational table of how the proto-to-go
// concepts map to the Types of an ast.Field. An arrow indicates "nested
// within".
//
// | Type Genres | Repeated | Naked |
// |-------------|------------------------|---------------|
// | Enum | Array -> Ident | Ident |
// | Message | Array -> Star -> Ident | Star -> Ident |
// | BaseType | Array -> Ident | Ident |
//
// Map types will always have a Key which is ident, and a value that is one of
// the Type Genres specified in the table above.
func NewField(f *ast.Field) (*Field, error) {
rv := &Field{
Name: f.Names[0].Name,
Type: &FieldType{},
}
typeFollower := func(e ast.Expr, typeFollower func(ast.Expr)) {
switch etyp := e.(type) {
// TypeFollower 'follows' the type of the provided ast.Field, determining
// the name of this fields type and if it's a StarExpr, an ArrayType, or
// both.
var typeFollower func(ast.Expr)
typeFollower = func(e ast.Expr) {
switch ex := e.(type) {
case *ast.Ident:
rv.Type.Name = etyp.Name
rv.Type.Name = ex.Name
case *ast.StarExpr:
rv.Type.StarExpr = true
typeFollower(etyp.X)
typeFollower(ex.X)
case *ast.ArrayType:
rv.Type.ArrayType = true
typeFollower(etyp.Elt)
typeFollower(ex.Elt)
case *ast.MapType:
// TODO call NewMap here
}
}
typeFollower(f.Type, typeFollower)
typeFollower(f.Type)
return rv, nil
}

53
pbinfo/resolvetypes.go Normal file
Просмотреть файл

@ -0,0 +1,53 @@
package pbinfo
// After the initial creation of Catalog, each FieldType will have it's name
// set to the name of the type that it represents, but it won't have a pointer
// to the full instance of the type with that name. Type resolution is the
// process of taking the name of each FieldType, then searching for the
// enum/message with that name and setting the respective *Message/*Enum
// property of our FieldType to point to that enum/message.
type typeBox struct {
Message *Message
Enum *Enum
}
// resolveTypes accepts a pointer to a Catalog and modifies that Catalog, and
// it's child structs, in place.
func resolveTypes(cat *Catalog) {
tmap := newTypeMap(cat)
for _, m := range cat.Messages {
for _, f := range m.Fields {
setType(f.Type, tmap)
}
}
for _, m := range cat.Service.Methods {
setType(m.RequestType, tmap)
setType(m.ResponseType, tmap)
}
}
func setType(f *FieldType, tmap map[string]typeBox) {
entry, ok := tmap[f.Name]
if !ok {
return
}
switch {
case entry.Enum != nil:
f.Enum = entry.Enum
case entry.Message != nil:
f.Message = entry.Message
}
}
// newTypeMap returns a map from
func newTypeMap(cat *Catalog) map[string]typeBox {
rv := make(map[string]typeBox)
for _, m := range cat.Messages {
rv[m.Name] = typeBox{Message: m}
}
for _, e := range cat.Enums {
rv[e.Name] = typeBox{Enum: e}
}
return rv
}

Просмотреть файл

@ -20,6 +20,7 @@ It has these top-level messages:
NestedMapMessageC
MapTypeResponse
MapNestedMsg
RepeatedTypes
*/
package TEST
@ -687,6 +688,17 @@ func (m *MapNestedMsg) GetBeta() map[int64]*NestedMessageA {
return nil
}
type RepeatedTypes struct {
AA []int64 `protobuf:"varint,1,rep,packed,name=AA" json:"AA,omitempty"`
BB []string `protobuf:"bytes,2,rep,name=BB" json:"BB,omitempty"`
CC []EnumType `protobuf:"varint,3,rep,packed,name=CC,enum=TEST.EnumType" json:"CC,omitempty"`
}
func (m *RepeatedTypes) Reset() { *m = RepeatedTypes{} }
func (m *RepeatedTypes) String() string { return proto.CompactTextString(m) }
func (*RepeatedTypes) ProtoMessage() {}
func (*RepeatedTypes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
func init() {
proto.RegisterType((*NestedTypeRequest)(nil), "TEST.NestedTypeRequest")
proto.RegisterType((*NestedMessageA)(nil), "TEST.NestedMessageA")
@ -699,6 +711,7 @@ func init() {
proto.RegisterType((*NestedMapMessageC)(nil), "TEST.NestedMapMessageC")
proto.RegisterType((*MapTypeResponse)(nil), "TEST.MapTypeResponse")
proto.RegisterType((*MapNestedMsg)(nil), "TEST.MapNestedMsg")
proto.RegisterType((*RepeatedTypes)(nil), "TEST.RepeatedTypes")
proto.RegisterEnum("TEST.EnumType", EnumType_name, EnumType_value)
}
@ -876,82 +889,85 @@ var _Map_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("svc.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 1232 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x99, 0xdd, 0x52, 0x23, 0x45,
0x1f, 0x87, 0xdf, 0x49, 0xf3, 0x31, 0xf4, 0xf2, 0x11, 0xe6, 0x05, 0xb7, 0x8b, 0xc2, 0x59, 0x8c,
0xa2, 0x88, 0x4e, 0x18, 0x71, 0x9d, 0xb2, 0x38, 0x9b, 0xef, 0x6f, 0xcb, 0x8a, 0xdc, 0x40, 0xd4,
0x29, 0x6a, 0xcb, 0x35, 0x89, 0x9b, 0xb0, 0x16, 0x1e, 0x7a, 0x03, 0x1e, 0x78, 0x15, 0x5e, 0x8f,
0x5e, 0x82, 0xe7, 0xde, 0x82, 0xf5, 0x9f, 0xf4, 0xc0, 0x9f, 0x61, 0xba, 0x5b, 0xab, 0xf4, 0xc0,
0x2a, 0x8e, 0x60, 0xc9, 0xf3, 0x9b, 0xce, 0x86, 0x67, 0xc9, 0xc3, 0x2c, 0xdd, 0x98, 0xbf, 0xfe,
0x6a, 0x38, 0x7b, 0x35, 0x5d, 0x4c, 0x8d, 0x95, 0xcb, 0xf0, 0x8b, 0xcb, 0x83, 0xc3, 0xab, 0xe9,
0xf4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 0xb5, 0xfa, 0xbf,
0x88, 0x3e, 0xfe, 0x33, 0x00, 0x00, 0xff, 0xff, 0x56, 0xdd, 0x29, 0xb1, 0x53, 0x1a, 0x00, 0x00,
// 1271 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x99, 0xdd, 0x6e, 0xe3, 0x44,
0x1c, 0x47, 0xb1, 0xa7, 0xdb, 0x3a, 0xb3, 0xdb, 0x34, 0x35, 0x2d, 0x3b, 0xaa, 0x8a, 0x37, 0x04,
0x0a, 0xa5, 0xe0, 0xd4, 0x94, 0xc5, 0x42, 0xbd, 0xf3, 0x57, 0x9c, 0x38, 0x36, 0xa0, 0xd0, 0x17,
0x30, 0x60, 0x55, 0x2b, 0x96, 0x24, 0xac, 0xd3, 0x45, 0xe5, 0x92, 0x17, 0xe0, 0x82, 0xa7, 0xe0,
0x79, 0xe0, 0x11, 0xb8, 0xe7, 0x15, 0xd0, 0xdf, 0x19, 0x77, 0xff, 0x75, 0x3d, 0x33, 0x20, 0xc1,
0x05, 0x52, 0xaf, 0xfa, 0x91, 0xf3, 0xf3, 0x44, 0xe9, 0xd9, 0xf6, 0xc4, 0x4b, 0x3b, 0xe5, 0xcb,
0xaf, 0x87, 0xcb, 0x17, 0x8b, 0xd5, 0xc2, 0xdc, 0xb8, 0x88, 0xbe, 0xbc, 0x38, 0x38, 0xbc, 0x5c,
0x2c, 0x2e, 0x9f, 0x17, 0xa7, 0xf9, 0xf2, 0xd9, 0x69, 0x3e, 0x9f, 0x2f, 0x56, 0xf9, 0xea, 0xd9,
0x62, 0x5e, 0xae, 0x99, 0xc1, 0x35, 0xdd, 0xfd, 0xac, 0x28, 0x57, 0xc5, 0x37, 0x17, 0xd7, 0xcb,
0x62, 0x56, 0x7c, 0x7f, 0x55, 0x94, 0x2b, 0x73, 0x40, 0x35, 0x8f, 0x69, 0x7d, 0xed, 0xf8, 0xe1,
0xd9, 0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xff, 0x05,
0x3c, 0xbf, 0x46, 0xa4, 0x1a, 0x00, 0x00,
}

Просмотреть файл

@ -146,3 +146,9 @@ message MapNestedMsg {
map<int64, NestedMessageA> Beta = 2;
}
message RepeatedTypes {
repeated int64 AA = 1;
repeated string BB = 2;
repeated EnumType CC = 3;
}