ch12ex09

package
v0.0.0-...-4489971 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ch12ex09 provides a token-based API to decode S-expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

A Decoder represents an S-epxressions parser reading tokens from an input stream.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder creates a new Deocoder reading from r.

func (*Decoder) Token

func (d *Decoder) Token() (Token, error)

Token returns the next S-expression token in the input stream. At the end of the input stream, Token returns nil, io.EOF.

type EndList

type EndList byte

EndList represents the end of a list.

func (EndList) String

func (s EndList) String() string

type Int

type Int int

An Int is an S-expression integer value.

type StartList

type StartList byte

StartList represents the beginning of a list.

func (StartList) String

func (s StartList) String() string

type String

type String string

A String is an S-expression string value.

type Symbol

type Symbol string

A Symbol is an unquoted name.

type Token

type Token interface{}

A Token is an interface holding one of the token types: Symbol, String, Int, StartList, or EndList.

Jump to

Keyboard shortcuts

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