ast

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Node
	CommandNode()
}

Command - Part of sequence - represent single static command Example: SELECT * FROM Customers

type CreateCommand

type CreateCommand struct {
	Token       token.Token
	Name        *Identifier // name of the table
	ColumnNames []string
	ColumnTypes []token.Token
}

func (CreateCommand) CommandNode

func (ls CreateCommand) CommandNode()

func (CreateCommand) TokenLiteral

func (ls CreateCommand) TokenLiteral() string

type Expression

type Expression interface {
	Node
	// contains filtered or unexported methods
}

Expression - Mathematical expression Example: CustomerID<5

type Identifier

type Identifier struct {
	Token token.Token // the token.IDENT token
}

type InsertCommand

type InsertCommand struct {
	Token  token.Token
	Name   *Identifier // name od the table
	Values []token.Token
}

func (InsertCommand) CommandNode

func (ls InsertCommand) CommandNode()

func (InsertCommand) TokenLiteral

func (ls InsertCommand) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
}

Node is connector between commands and expressions

type SelectCommand

type SelectCommand struct {
	Token token.Token
	Name  *Identifier
	Space []token.Token // ex. column names
}

func (SelectCommand) CommandNode

func (ls SelectCommand) CommandNode()

func (SelectCommand) TokenLiteral

func (ls SelectCommand) TokenLiteral() string

type Sequence

type Sequence struct {
	Commands []Command
}

Sequence - Sequence of operations commands Example: Command[0] = SELECT * FROM Customers Command[1] = WHERE City LIKE '%es%';

func (*Sequence) TokenLiteral

func (p *Sequence) TokenLiteral() string

Jump to

Keyboard shortcuts

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