parser

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add struct {
	Import string
	Jump   int
}

Add (and increment) rule description

type ParseError

type ParseError struct {
	Report  string
	Details string
}

ParseError error to

func (ParseError) Error

func (p ParseError) Error() string

type Prefix

type Prefix struct {
	From string
	To   string
}

Prefix rule description

type Regexp

type Regexp struct {
	From string
	To   string
}

Regexp rule description

type Rule

type Rule interface {
	// contains filtered or unexported methods
}

Rule abstract rule description

func Parse

func Parse(input string) (Rule, error)

Parse parser input string into corresponding rule

type Scanner

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

Scanner input scanner

func NewScanner

func NewScanner(orig string) *Scanner

NewScanner scanner constructor

func (*Scanner) AtEnd

func (s *Scanner) AtEnd() error

AtEnd проверка, что правило вычитано

func (*Scanner) Copy

func (s *Scanner) Copy() *Scanner

Copy creates a copy of given scanner

func (*Scanner) FancyIndicator

func (s *Scanner) FancyIndicator(rng int, questions int) string

FancyIndicator цветной выхлоп для диагностики ошибок в правиле

func (*Scanner) NextInt

func (s *Scanner) NextInt() (int, error)

NextInt returns int

func (*Scanner) NextOperator

func (s *Scanner) NextOperator() (string, error)

NextOperator returns operator (one of =>, ++, += and //)

func (*Scanner) NextString

func (s *Scanner) NextString() (string, error)

NextString retrieves next contiguous text

Jump to

Keyboard shortcuts

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