bytebase

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorSyntaxEmptyStack                     = errors.New("empty syntax stack")
	ErrorSyntaxEncloseIncorrectSymbol         = errors.New("invalid operation, not ]|} to enclose")
	ErrorSyntaxEncloseSymbolNotMatch          = errors.New("enclose symbol not match")
	ErrorSyntaxEncloseSymbolIncorrect         = errors.New("enclose symbol incorrect")
	ErrorSyntaxCommaBehindLastItem            = errors.New("find `,]` or `,}` in the syntax checker")
	ErrorSyntaxElementNotSeparatedByComma     = errors.New("syntax element not separated by comma")
	ErrorSyntaxUnexpectedSymbolInArray        = errors.New("unexpected symbol in array")
	ErrorSyntaxExtendedSyntaxVariableAsKey    = errors.New("extended syntax variable as key")
	ErrorSyntaxObjectSymbolNotMatch           = errors.New("object symbol not match")
	ErrorIncorrectSyntaxSymbolForConstructAST = errors.New("incorrect character for construct ast")

	ErrorIncorrectCharacter     = errors.New("incorrect character")
	ErrorIncorrectValueForState = errors.New("extracted value not match state")
)

Functions

func GetTokenTypeByStartCharacter

func GetTokenTypeByStartCharacter(b byte) token.TokenType

in json k-v start bytes

func ShouldUnreadByte

func ShouldUnreadByte(t token.TokenType) bool

these symbols should be unread to buffer, they are read first to determine the state change, not using peek to collect them because there may be a long way to go till we see it.

Types

type ASTByteBaseBuilder

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

func NewASTByteBaseBuilder

func NewASTByteBaseBuilder(reader io.Reader) *ASTByteBaseBuilder

func (*ASTByteBaseBuilder) GetAST

func (i *ASTByteBaseBuilder) GetAST() ast.JsonNode

func (*ASTByteBaseBuilder) GetNextTokenType

func (t *ASTByteBaseBuilder) GetNextTokenType() (token.TokenType, error)

put the store to syntax symbol here, to decouple the relation of reader and writer

func (*ASTByteBaseBuilder) HasComplete

func (i *ASTByteBaseBuilder) HasComplete() bool

func (*ASTByteBaseBuilder) HasOpenElements

func (i *ASTByteBaseBuilder) HasOpenElements() bool

func (*ASTByteBaseBuilder) ReadBool

func (t *ASTByteBaseBuilder) ReadBool() (bool, error)

func (*ASTByteBaseBuilder) ReadNull

func (t *ASTByteBaseBuilder) ReadNull() error

func (*ASTByteBaseBuilder) ReadNumber

func (t *ASTByteBaseBuilder) ReadNumber() (interface{}, error)

func (*ASTByteBaseBuilder) ReadString

func (t *ASTByteBaseBuilder) ReadString() ([]byte, error)

func (*ASTByteBaseBuilder) ReadVariable

func (t *ASTByteBaseBuilder) ReadVariable() ([]byte, error)

func (*ASTByteBaseBuilder) RecordStateValue

func (t *ASTByteBaseBuilder) RecordStateValue(valueType ast.AST_NODETYPE, nodeValue interface{}) error

func (*ASTByteBaseBuilder) RecordSyntaxSymbol

func (t *ASTByteBaseBuilder) RecordSyntaxSymbol(b token.TokenType) error

func (*ASTByteBaseBuilder) TopElementType

func (i *ASTByteBaseBuilder) TopElementType() (ast.AST_NODETYPE, error)

Jump to

Keyboard shortcuts

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