parser

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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