parser

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Code generated by parser-gen. DO NOT EDIT.

Package parser represents the parser.Interface and some errors for implementing parsers.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotBool = fmt.Errorf("value is not a bool")

ErrNotBool is an error that represents a type error.

View Source
var ErrNotBytes = fmt.Errorf("value is not a bytes")

ErrNotBytes is an error that represents a type error.

View Source
var ErrNotDouble = fmt.Errorf("value is not a double")

ErrNotDouble is an error that represents a type error.

View Source
var ErrNotInt = fmt.Errorf("value is not a int")

ErrNotInt is an error that represents a type error.

View Source
var ErrNotString = fmt.Errorf("value is not a string")

ErrNotString is an error that represents a type error.

View Source
var ErrNotUint = fmt.Errorf("value is not a uint")

ErrNotUint is an error that represents a type error.

Functions

func Sprint

func Sprint(value Value) string

Sprint returns a value printed as a string.

Types

type Interface

type Interface interface {
	Next() error
	IsLeaf() bool
	Up()
	Down()
	Value
}

A type conforming to the parser.Interface interface, abstracts away the implementation details of a parser.

type Value

type Value interface {
	Double() (float64, error)
	Int() (int64, error)
	Uint() (uint64, error)
	Bool() (bool, error)
	String() (string, error)
	Bytes() ([]byte, error)
}

A type confirming to the parser.Value interface, repesents one native value, tree node label (field name) or some repesentation a node label. Typically only one of the methods returns a value without an error, but more than one method can return without an error. For example a positive json number can return an errorless value for the Double, Int and Uint methods.

Directories

Path Synopsis
The debug package is great for testing and debugging of parser.Interface implementations.
The debug package is great for testing and debugging of parser.Interface implementations.
debug-gen
Command debug-gen generates some of the code in the debug package.
Command debug-gen generates some of the code in the debug package.
Package json contains the implementation of a JSON parser.
Package json contains the implementation of a JSON parser.
Command parser-gen generates some of the code in the parser package.
Command parser-gen generates some of the code in the parser package.
Package proto contains an implementation of a protocol buffer parser.
Package proto contains an implementation of a protocol buffer parser.
prototests
Package prototests contains some structures and values that are useful for testing the protocol buffer parser.
Package prototests contains some structures and values that are useful for testing the protocol buffer parser.
Package reflect contains an implementation of a parser for a reflected go structure.
Package reflect contains an implementation of a parser for a reflected go structure.
Package xml contains a parser for XML.
Package xml contains a parser for XML.

Jump to

Keyboard shortcuts

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