Documentation
¶
Index ¶
- Variables
- func GetTokenTypeByStartCharacter(b byte) token.TokenType
- func ShouldUnreadByte(t token.TokenType) bool
- type ASTByteBaseBuilder
- func (i *ASTByteBaseBuilder) GetAST() ast.JsonNode
- func (t *ASTByteBaseBuilder) GetNextTokenType() (token.TokenType, error)
- func (i *ASTByteBaseBuilder) HasComplete() bool
- func (i *ASTByteBaseBuilder) HasOpenElements() bool
- func (t *ASTByteBaseBuilder) ReadBool() (bool, error)
- func (t *ASTByteBaseBuilder) ReadNull() error
- func (t *ASTByteBaseBuilder) ReadNumber() (interface{}, error)
- func (t *ASTByteBaseBuilder) ReadString() ([]byte, error)
- func (t *ASTByteBaseBuilder) ReadVariable() ([]byte, error)
- func (t *ASTByteBaseBuilder) RecordStateValue(valueType ast.AST_NODETYPE, nodeValue interface{}) error
- func (t *ASTByteBaseBuilder) RecordSyntaxSymbol(b token.TokenType) error
- func (i *ASTByteBaseBuilder) TopElementType() (ast.AST_NODETYPE, error)
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 ¶
in json k-v start bytes
func ShouldUnreadByte ¶
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)
Click to show internal directories.
Click to hide internal directories.