parser

package
v0.0.0-...-ff9052a Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2014 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TopMode = iota
	ImportMode
	RouteMode
	IncludeMode
	UsingMode
	DoesMode
	FromMode
)

Insertion modes

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name, Cmd string
	Params    []*Using
	// contains filtered or unexported fields
}

func (*Command) IsIncludes

func (c *Command) IsIncludes() bool

type EventHandler

type EventHandler interface {
	Error(error)
	Literal(string)
	Strval(string)

	Import()
	Includes()
	Route()
	Using()
	Does()
	From()
}

func Parse

func Parse(input io.Reader) (EventHandler, error)

type Registry

type Registry interface {
	Routes() []*Route
	Imports() []string
}

type Route

type Route struct {
	Name, Description string
	Commands          []*Command
	// contains filtered or unexported fields
}

type Serializer

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

func NewSerializer

func NewSerializer(name, packname string, out io.Writer, reg Registry) *Serializer

NewSerializer creates a new serializer.

name is used to construct the function callback. "foo" becomes "func FooRoutes(reg *cookoo.Registry)" packname is used to construct the package. "foo" becomes "package foo"

func (*Serializer) Write

func (s *Serializer) Write() error

type Tokenizer

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

func NewTokenizer

func NewTokenizer(input io.Reader, e EventHandler) *Tokenizer

func (*Tokenizer) Next

func (z *Tokenizer) Next()

type Using

type Using struct {
	From             []string
	Name, DefaultVal string
}

Jump to

Keyboard shortcuts

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