parser

package
v0.0.0-...-727adce Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMoreThanOneChild = newParserError("more than one child")
View Source
var ErrNoSuchLanguage = newParserError("no such language")

Functions

func RegisterParser

func RegisterParser(name string, parser IParser)

Types

type IParser

type IParser interface {
	GetDBQuery(p *Parser) (interface{}, error)
	GetDBQueryWithReplacement(p *Parser, a ...interface{}) (interface{}, error)
}

type ObjectOperand

type ObjectOperand struct {
	Properties string
}

func (*ObjectOperand) GetData

func (o *ObjectOperand) GetData() (interface{}, error)

type Operand

type Operand interface {
	GetData() (interface{}, error)
}

type Operation

type Operation struct {
	Operator Operator  `json:"operator"`
	Operands []Operand `json:"operands,omitempty"`
}

func (*Operation) GetData

func (o *Operation) GetData() (interface{}, error)

func (*Operation) ReplaceOperands

func (o *Operation) ReplaceOperands(a ...interface{}) (*Operation, error)

type Operator

type Operator int
const (
	NoOp Operator = -1
)

func (*Operator) MarshalJSON

func (o *Operator) MarshalJSON() ([]byte, error)

type Parser

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

func NewParser

func NewParser(input string) (*Parser, error)

func (*Parser) GetDBQuery

func (p *Parser) GetDBQuery(language string) (interface{}, error)

func (*Parser) GetDBQueryWithReplacement

func (p *Parser) GetDBQueryWithReplacement(language string, a ...interface{}) (interface{}, error)

func (*Parser) GetOperation

func (p *Parser) GetOperation() (*Operation, error)

func (*Parser) ReplaceOperands

func (p *Parser) ReplaceOperands(a ...interface{}) (*Parser, error)

type ParsingError

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

func (*ParsingError) Error

func (e *ParsingError) Error() string

type SliceOperand

type SliceOperand struct {
	Slice []Operand
}

func (*SliceOperand) GetData

func (s *SliceOperand) GetData() (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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