lexer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSV

func CSV(input []byte) (tokens <-chan CSVToken)

func Form

func Form(data []byte, class map[FormToken]string) ([]byte, error)

func JSON

func JSON(input []byte) (tokens <-chan JSONToken)

func XML

func XML(data []byte, class map[XMLToken]string) ([]byte, error)

Types

type CSVToken

type CSVToken struct {
	Type  CSVTokenType
	Value []byte
}

type CSVTokenType

type CSVTokenType uint8
const (
	CSV_COM CSVTokenType // ','
	CSV_HED              // header name
	CSV_FLD              // record field
	CSV_NL               // new line
	CSV_EOF              // end of the csv input
)

func (CSVTokenType) String

func (t CSVTokenType) String() string

mainly for debugging

type FormToken

type FormToken uint

type JSONToken

type JSONToken struct {
	Type  JSONTokenType
	Value []byte
}

type JSONTokenType

type JSONTokenType uint8
const (
	JSON_LSB JSONTokenType // '['
	JSON_RSB               // ']'
	JSON_LCB               // '{'
	JSON_RCB               // '}'
	JSON_CLN               // ':'
	JSON_COM               // ','
	JSON_STR               // a json string
	JSON_NUM               // a json number
	JSON_TRU               // 'true'
	JSON_FAL               // 'false'
	JSON_NUL               // 'null'
	JSON_KEY               // a json object key
	JSON_WS                // white space
	JSON_EOF               // end of the json input
)

func (JSONTokenType) String

func (t JSONTokenType) String() string

mainly for debugging

type XMLToken

type XMLToken uint

Jump to

Keyboard shortcuts

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