parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package parser creates sequences from tokens

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArithmeticLessThanZeroParserError added in v1.0.0

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

ArithmeticLessThanZeroParserError - error thrown when parser found integer value that shouldn't be less than 0, but it is

func (*ArithmeticLessThanZeroParserError) Error added in v1.0.0

type IllegalPeriodInIdentParserError added in v1.0.0

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

IllegalPeriodInIdentParserError - error thrown when parser found period in ident when parsing create command

func (*IllegalPeriodInIdentParserError) Error added in v1.0.0

type LogicalExpressionParsingError added in v1.0.0

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

LogicalExpressionParsingError - error thrown when logical expression inside WHERE statement couldn't be parsed correctly

func (*LogicalExpressionParsingError) Error added in v1.0.0

type NoApostropheOnLeftParserError added in v1.0.0

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

NoApostropheOnLeftParserError - error thrown when parser found no apostrophe on left of ident

func (*NoApostropheOnLeftParserError) Error added in v1.0.0

type NoApostropheOnRightParserError added in v1.0.0

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

NoApostropheOnRightParserError - error thrown when parser found no apostrophe on right of ident

func (*NoApostropheOnRightParserError) Error added in v1.0.0

type NoPredecessorParserError added in v1.0.0

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

NoPredecessorParserError - error thrown when parser found integer value that shouldn't be less than 0, but it is

func (*NoPredecessorParserError) Error added in v1.0.0

func (m *NoPredecessorParserError) Error() string

type Parser

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

Parser - Contain token that is currently analyzed by parser and the next one. Lexer is used to tokenize the client text input.

func New

func New(lexer *lexer.Lexer) *Parser

New - Return new Parser struct

func (*Parser) ParseSequence

func (parser *Parser) ParseSequence() (*ast.Sequence, error)

ParseSequence - Return ast.Sequence (sequence of commands) created from client input after tokenization

Parse tokens returned by lexer to structures defines in ast package, and it's responsible for syntax validation.

type SyntaxCommandExpectedError added in v1.0.0

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

SyntaxCommandExpectedError - error thrown when there was command that logically should only appear after certain different command, but it wasn't found

func (*SyntaxCommandExpectedError) Error added in v1.0.0

type SyntaxError added in v1.0.0

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

SyntaxError - error thrown when parser was expecting different token from lexer

func (*SyntaxError) Error added in v1.0.0

func (m *SyntaxError) Error() string

type SyntaxInvalidCommandError added in v1.0.0

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

SyntaxInvalidCommandError - error thrown when invalid (non-existing) type of command has been found

func (*SyntaxInvalidCommandError) Error added in v1.0.0

func (m *SyntaxInvalidCommandError) Error() string

Jump to

Keyboard shortcuts

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