xpath

package
v0.0.0-...-e7b8920 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: GPL-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UDPE mainQueryType = iota
	NUDPE
)
View Source
const (
	Undefined customBool = iota
	False
	True
)

Custom boolean values which comprises the 'Undefined' value

View Source
const (
	ELEM      = iota
	NEW_AXIOM = iota

	CLOSETAG     = 0x8000 + iota - _NUM_NONTERMINALS
	OPENCLOSETAG = 0x8000 + iota - _NUM_NONTERMINALS
	OPENTAG      = 0x8000 + iota - _NUM_NONTERMINALS
	TEXT         = 0x8000 + iota - _NUM_NONTERMINALS
)
View Source
const (
	FPE udpeType = iota
	RPE
)

Variables

View Source
var Stats parsingStats

Stats contains some statistics that may be checked after a call to ParseString or ParseFile

Functions

func ParseFile

func ParseFile(filename string, numThreads int) (*symbol, error)

ParseFile parses a file in parallel using an operator precedence grammar. It takes as input a filename and the number of threads, and returns a boolean representing the success or failure of the parsing and the symbol at the root of the syntactic tree (if successful).

func ParseString

func ParseString(str []byte, numThreads int) (result *symbol, err error)

ParseString parses a string in parallel using an operator precedence grammar. It takes as input a string as a slice of bytes and the number of threads, and returns a boolean representing the success or failure of the parsing and the symbol at the root of the syntactic tree (if successful).

func SetCPUProfileFile

func SetCPUProfileFile(file *os.File)

Types

type ExecutorCommand

type ExecutorCommand interface {
	Execute(xpathQuery string) ExecutorCommand
	AgainstFile(documentFilePath string) ExecutorCommand
	AgainstString(input []byte) ExecutorCommand
	WithNumberOfThreads(numberOfThreads int) ExecutorCommand
	Go() (results []Position, err error)
	InVerboseMode() ExecutorCommand
}

ExecutorCommand represents a command that can be made by a client to execute a XPath query

func AgainstFile

func AgainstFile(documentFilePath string) ExecutorCommand

AgainstFile specify the path of the file against which the XPath query has to be executed

func Execute

func Execute(xpathQuery string) ExecutorCommand

Execute specify the XPath query to be executed

func WithNumberOfThreads

func WithNumberOfThreads(numberOfThreads int) ExecutorCommand

WithNumberOfThreads specify the number of threads to be used to execute the XPath query

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

type Position

type Position interface {
	Extremes() (start, end int)
	Start() int
	End() int
}

Position represents the position of some information inside a document in terms of number of characters from the beginning of the document.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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