scanner

package
v0.0.0-...-f5d25ad Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package scanner implements a tokenizer that creates tokens of the SQLite grammar.

Index

Constants

View Source
const (
	ErrUnexpectedToken   = Error("unexpected token")
	ErrInvalidUTF8String = Error("input is not a valid utf8 encoded string")
)

Constant errors

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error allows constant errors.

func (Error) Error

func (s Error) Error() string

type Scanner

type Scanner interface {
	Next() token.Token
	Peek() token.Token
}

Scanner is the interface that describes a scanner.

func NewRuleBased

func NewRuleBased(input string, ruleset ruleset.Ruleset) (Scanner, error)

NewRuleBased creates a new, ready to use rule based scanner with the given ruleset, that will process the given input rune slice.

Directories

Path Synopsis
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.
Package ruleset implements rules that can be used in combination with a rule based scanner.
Package ruleset implements rules that can be used in combination with a rule based scanner.
Package token implements tokens that are produced by the scanner.
Package token implements tokens that are produced by the scanner.

Jump to

Keyboard shortcuts

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