parser

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

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_Dot         // .
	Token_Enum        // enum
	Token_Struct      // struct
	Token_Assign      // =
)

自定义的token id

Variables

This section is empty.

Functions

func ParseFile

func ParseFile(fileName string) (*model.DescriptorSet, error)

func ParseFileList

func ParseFileList(dset *model.DescriptorSet, filelist ...string) error

func ParseString

func ParseString(script string) (*model.DescriptorSet, error)

Types

type Context

type Context struct {
	SourceName string

	*model.DescriptorSet

	*model.Descriptor

	*model.FieldDescriptor
	// contains filtered or unexported fields
}

func (*Context) AddSymbol

func (self *Context) AddSymbol(v interface{}, pos golexer.TokenPos)

func (Context) CommentGroupByLine

func (self Context) CommentGroupByLine(line int) model.Comment

func (Context) Expect

func (self Context) Expect(id int) golexer.Token

func (Context) NextToken

func (self Context) NextToken()

func (*Context) QuerySymbolPosString

func (self *Context) QuerySymbolPosString(v interface{}) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL