parser

package
v1.6.33 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBaseType

func IsBaseType(text string) bool

IsBaseType returns true if the given type is a base type.

func Parse

func Parse(filename string, src interface{}) (*spec.ApiSpec, error)

Parse parses the given file and returns the parsed spec.

Types

type API

type API struct {
	Filename string
	Syntax   *ast.SyntaxStmt

	TypeStmt     []ast.TypeStmt
	ServiceStmts []*ast.ServiceStmt
	// contains filtered or unexported fields
}

API is the parsed api file.

func (*API) SelfCheck

func (api *API) SelfCheck() error

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer analyzes the ast and converts it to spec.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is the parser for api file.

func New

func New(filename string, src interface{}) *Parser

New creates a new parser.

func (*Parser) CheckErrors

func (p *Parser) CheckErrors() error

CheckErrors check parser errors.

func (*Parser) Parse

func (p *Parser) Parse() *ast.AST

Parse parses the api file.

func (*Parser) ParseForUintTest

func (p *Parser) ParseForUintTest() *ast.AST

ParseForUintTest parse the source code for unit test.

Jump to

Keyboard shortcuts

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