statement

package
v1.1.1-0...-69c5354 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandStr

func RandStr(n int) string

RandStr returns a string of random characters with length n

Types

type Parser

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

Parser turns the file from raw text into an AST

func NewParser

func NewParser(r io.Reader) *Parser

NewParser creates a new Parser

func (*Parser) Parse

func (p *Parser) Parse() (statement.Statement, error)

Parse returns a Statement

func (*Parser) ParseExecStatement

func (p *Parser) ParseExecStatement() (*statement.ExecStatement, error)

ParseExecStatement returns a ExecStatement

func (*Parser) ParseFunction

func (p *Parser) ParseFunction() (*statement.Function, error)

ParseFunction returns a Function

func (*Parser) ParseGoStatement

func (p *Parser) ParseGoStatement() (*statement.GoStatement, error)

ParseGoStatement returns a GoStatement

func (*Parser) ParseInsertStatement

func (p *Parser) ParseInsertStatement() (*statement.InsertStatement, error)

ParseInsertStatement returns a InsertStatement

func (*Parser) ParseQueryStatement

func (p *Parser) ParseQueryStatement() (*statement.QueryStatement, error)

ParseQueryStatement returns a QueryStatement

func (*Parser) ParseSetStatement

func (p *Parser) ParseSetStatement() (*statement.SetStatement, error)

ParseSetStatement returns a SetStatement

func (*Parser) ParseTemplate

func (p *Parser) ParseTemplate() (*statement.Template, error)

ParseTemplate returns a Template

func (*Parser) ParseTimestamp

func (p *Parser) ParseTimestamp() (*statement.Timestamp, error)

ParseTimestamp returns a Timestamp

func (*Parser) ParseWaitStatement

func (p *Parser) ParseWaitStatement() (*statement.WaitStatement, error)

ParseWaitStatement returns a WaitStatement

type Scanner

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

Scanner scans over the file and converts the raw text into tokens

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan moves to the next character in the file and returns a tokenized version as well as the literal

type Token

type Token int

Token represents a lexical token.

const (
	ILLEGAL Token = iota
	EOF

	WS

	// IDENT and the following are InfluxQL literal tokens.
	IDENT       // main
	NUMBER      // 12345.67
	DURATIONVAL // 13h
	STRING      // "abc"
	BADSTRING   // "abc
	TEMPLATEVAR // %f

	COMMA    // ,
	LPAREN   // (
	RPAREN   // )
	LBRACKET // [
	RBRACKET // ]
	PIPE     // |
	PERIOD   // .

	SET
	USE
	QUERY
	INSERT
	GO
	DO
	WAIT
	STR
	INT
	FLOAT
	EXEC
)

The following tokens represent the different values in the AST that make up stressql

Jump to

Keyboard shortcuts

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