scanner

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package scanner implements a HANA SQL query scanner.

For a detailed HANA SQL query syntax please see https://help.sap.com/doc/6254b3bb439c4f409a979dc407b49c9b/2.0.00/en-US/SAP_HANA_SQL_Script_Reference_en.pdf

Index

Constants

View Source
const (
	EOF = -(iota + 1)
	Error
	Undefined
	Operator
	Delimiter
	IdentifierDelimiter
	Identifier
	QuotedIdentifier
	Variable
	PosVariable
	NamedVariable
	String
	Number
)

Token constants.

Variables

View Source
var ErrToken = errors.New("Invalid token")

ErrToken is raised when a token is malformed (e.g. string with missing ending quote).

Functions

func TokenString

func TokenString(tok rune) string

TokenString returns a printable string for a token or Unicode character.

Types

type Scanner

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

Scanner is a HANA SQL query string scanner.

func NewScanner

func NewScanner(str string) *Scanner

NewScanner creates a new Scaner instance.

func (*Scanner) FreeScanner

func (s *Scanner) FreeScanner()

FreeScanner pools the Scanner instance for later usage. Scanner instances are not thread safe. After the call of FreeScanner calls of Scanner methods lead to undefined behavior.

func (*Scanner) Next

func (s *Scanner) Next() rune

Next returns the next Token.

func (*Scanner) Value

func (s *Scanner) Value() string

Value returns the value of the Token returned by Next.

Jump to

Keyboard shortcuts

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