hdl

package
v0.0.0-...-dfe2263 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Raw lex.Type = iota
	Ident
	BracketOpen
	BracketClose
	Comma
	Int
	Range
	Equal
)

Tokens

Variables

This section is empty.

Functions

func Lexer

func Lexer(input string) lex.Interface

Lexer returns a new lexer for i/o specs and connection descriptions.

Types

type Parser

type Parser struct {
	Input string
	// contains filtered or unexported fields
}

Parser is a simplistic parser

func (*Parser) Next

func (p *Parser) Next(conns, allowRange bool) (PinExpr, error)

Next returns the next item in the input stream It only recognizes pin names followed by an index or range and separated by commas. conns specifies if reading a connection config strings, in which case the only possible return type is *PinAssignment or nil at EOF.

type Pin

type Pin struct {
	Name string
	// contains filtered or unexported fields
}

Pin is a simple pin name

func (*Pin) Pos

func (p *Pin) Pos() int

Pos implements PinExpr

func (*Pin) String

func (p *Pin) String() string

type PinAssignment

type PinAssignment struct {
	LHS PinExpr
	RHS PinExpr
}

PinAssignment is a part pin to chip pin assignment. pp=pc

func (*PinAssignment) Pos

func (p *PinAssignment) Pos() int

Pos implements PinExpr

func (*PinAssignment) String

func (p *PinAssignment) String() string

type PinExpr

type PinExpr interface {
	Pos() int
	String() string
}

PinExpr is a pin declaration expression.

type PinIndex

type PinIndex struct {
	*Pin
	Index int
}

PinIndex is an indexed pin p[index]

func (*PinIndex) String

func (p *PinIndex) String() string

type PinRange

type PinRange struct {
	*Pin
	Start int
	End   int
}

PinRange is a pin range p[start..end]

func (*PinRange) String

func (p *PinRange) String() string

Jump to

Keyboard shortcuts

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