Documentation
¶
Index ¶
- Constants
- func ParseFileList(fileset *FileDescriptorSet, filelist []string) (string, error)
- type CommentGroup
- type CommentParser
- type Descriptor
- type DescriptorType
- type FieldDescriptor
- func (self *FieldDescriptor) CompatibleTypeName() string
- func (self *FieldDescriptor) CompatibleTypeString() string
- func (self *FieldDescriptor) ExtendTypePrecision() int
- func (self *FieldDescriptor) IsExtendType() bool
- func (self *FieldDescriptor) Kind() string
- func (self *FieldDescriptor) String() string
- func (self *FieldDescriptor) TagNumber() int
- func (self *FieldDescriptor) TypeName() string
- func (self *FieldDescriptor) TypeString() string
- type FieldType
- type FileDescriptor
- type FileDescriptorSet
- type TaggedComment
Constants ¶
View Source
const ( CommentToken_EOF = iota CommentToken_LeftBrace CommentToken_RightBrace CommentToken_WhiteSpace CommentToken_LineEnd CommentToken_UnixStyleComment CommentToken_Identifier CommentToken_Unknown )
自定义的token id
View Source
const ( Token_EOF = iota Token_Unknown Token_LineEnd Token_Numeral Token_String Token_WhiteSpace Token_Identifier Token_UnixComment Token_CStyleComment Token_Colon // : Token_ParenL // ( Token_ParenR // ) Token_CurlyBraceL // { Token_CurlyBraceR // } Token_BracketL // [ Token_BracketR // ] Token_Star // * Token_Dot // . Token_Enum // Enum Token_Message // Message Token_FileTag // fileTag Token_Assign // = )
自定义的token id
Variables ¶
This section is empty.
Functions ¶
func ParseFileList ¶
func ParseFileList(fileset *FileDescriptorSet, filelist []string) (string, error)
Types ¶
type CommentGroup ¶
type CommentGroup struct { Pos golexer.TokenPos Leading string Trailing string // contains filtered or unexported fields }
func (*CommentGroup) String ¶
func (self *CommentGroup) String() string
type CommentParser ¶
func NewCommentParser ¶
func NewCommentParser(src string) *CommentParser
type Descriptor ¶
type Descriptor struct { *CommentGroup Name string SrcName string Type DescriptorType Fields []*FieldDescriptor FieldByName map[string]*FieldDescriptor FieldByTag map[int]*FieldDescriptor File *FileDescriptor TagBase int EnumValueIgnoreType bool }
func (*Descriptor) MaxTag ¶
func (self *Descriptor) MaxTag() (ret int)
func (*Descriptor) String ¶
func (self *Descriptor) String() string
func (*Descriptor) TypeName ¶
func (self *Descriptor) TypeName() string
type DescriptorType ¶
type DescriptorType int
const ( DescriptorType_None DescriptorType = iota DescriptorType_Enum DescriptorType_Struct )
type FieldDescriptor ¶
type FieldDescriptor struct { *CommentGroup Name string Type FieldType Tag int AutoTag int Repeatd bool MainIndex *FieldDescriptor Complex *Descriptor Struct *Descriptor }
func (*FieldDescriptor) CompatibleTypeName ¶
func (self *FieldDescriptor) CompatibleTypeName() string
func (*FieldDescriptor) CompatibleTypeString ¶
func (self *FieldDescriptor) CompatibleTypeString() string
func (*FieldDescriptor) ExtendTypePrecision ¶
func (self *FieldDescriptor) ExtendTypePrecision() int
func (*FieldDescriptor) IsExtendType ¶
func (self *FieldDescriptor) IsExtendType() bool
func (*FieldDescriptor) Kind ¶
func (self *FieldDescriptor) Kind() string
func (*FieldDescriptor) String ¶
func (self *FieldDescriptor) String() string
func (*FieldDescriptor) TagNumber ¶
func (self *FieldDescriptor) TagNumber() int
func (*FieldDescriptor) TypeName ¶
func (self *FieldDescriptor) TypeName() string
func (*FieldDescriptor) TypeString ¶
func (self *FieldDescriptor) TypeString() string
type FileDescriptor ¶
type FileDescriptor struct { FileName string Structs []*Descriptor StructByName map[string]*Descriptor Enums []*Descriptor EnumByName map[string]*Descriptor ObjectsBySrcName map[string]*Descriptor Objects []*Descriptor FileSet *FileDescriptorSet // contains filtered or unexported fields }
func NewFileDescriptor ¶
func NewFileDescriptor() *FileDescriptor
func (*FileDescriptor) MatchTag ¶
func (self *FileDescriptor) MatchTag(tag string) bool
func (*FileDescriptor) NameExists ¶
func (self *FileDescriptor) NameExists(name string) bool
func (*FileDescriptor) String ¶
func (self *FileDescriptor) String() string
type FileDescriptorSet ¶
type FileDescriptorSet struct { Files []*FileDescriptor // contains filtered or unexported fields }
func NewFileDescriptorSet ¶
func NewFileDescriptorSet() *FileDescriptorSet
func ParseFile ¶
func ParseFile(fileName string) (*FileDescriptorSet, error)
type TaggedComment ¶
Click to show internal directories.
Click to hide internal directories.