newick

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeStack added in v0.4.0

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

func NewNodestack added in v0.4.0

func NewNodestack() (ns *NodeStack)

Initialize a new Node Stack

func (*NodeStack) Clear added in v0.4.0

func (ns *NodeStack) Clear()

Clears the whole stack and all its elements

func (*NodeStack) Head added in v0.4.0

func (ns *NodeStack) Head() (n *tree.Node, e *tree.Edge, err error)

* Returns the head of the Stack, and an error if the stack is empty

func (*NodeStack) Pop added in v0.4.0

func (ns *NodeStack) Pop() (n *tree.Node, e *tree.Edge, err error)

* Pops and returns the head of the Stack. The calling function is responsible for freeing the elt: free(elt).

Returns an error if the stack is empty

func (*NodeStack) Push added in v0.4.0

func (ns *NodeStack) Push(n *tree.Node, e *tree.Edge)

Pushes a new node/edge pair to the Stack

type Parser

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

Parser represents a parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) Parse

func (p *Parser) Parse() (newtree *tree.Tree, err error)

Parses a Newick String.

type Scanner

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

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan returns the next token and literal value.

type Token

type Token int64
const (
	ILLEGAL Token = iota
	EOF
	WS
	IDENT      // Name of Node, or comment
	NUMERIC    // Any numerical value
	OPENPAR    // (
	CLOSEPAR   // )
	STARTLEN   // :
	OPENBRACK  // [ : For comment
	CLOSEBRACK // ] : For comment
	NEWSIBLING // ,
	EOT        // ;
)

Jump to

Keyboard shortcuts

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