parser

package
v0.0.0-...-0e7933b Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOWEST int
	PIPE
	ASSIGN
	FATARROW
	CONDOR
	CONDAND
	NULLCOALESCING //??
	TERNARY
	EQUALS
	LESSGREATER
	BITOR
	BITXOR
	BITAND
	SHIFTS
	SLICE
	DOTDOT
	SUM
	PRODUCT
	PREFIX
	MATCHING
	CALL
	INDEX
	INCREMENT
)

Variables

This section is empty.

Functions

func SplitSlice

func SplitSlice(list []ast.Node) [][]ast.Node

group by ast.Node's line number.

Types

type Mode

type Mode uint

A Mode value is a set of flags (or 0). They control the amount of source code parsed and other optional parser functionality.

const (
	ParseComments Mode = 1 << iota // parse comments and add them to AST
	Trace                          // print a trace of parsed productions
)

type Parser

type Parser struct {

	//for debugger use
	Functions map[string]*ast.FunctionLiteral
	// contains filtered or unexported fields
}

func New

func New(l *lexer.Lexer, wd string) *Parser

func NewWithDoc

func NewWithDoc(l *lexer.Lexer, wd string) *Parser

func (*Parser) ErrorLines

func (p *Parser) ErrorLines() []string

func (*Parser) Errors

func (p *Parser) Errors() []string

func (*Parser) ParseProgram

func (p *Parser) ParseProgram() *ast.Program

type SortByLine

type SortByLine []ast.Node

implement sort interface

var (
	FileLines []string

	DebugInfos SortByLine
)

func (SortByLine) Len

func (d SortByLine) Len() int

func (SortByLine) Less

func (d SortByLine) Less(i, j int) bool

func (SortByLine) Swap

func (d SortByLine) Swap(i, j int)

Jump to

Keyboard shortcuts

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