stack

package
v0.0.0-...-da378b8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package stack creates a ItemStack data structure for the Item type

generate a `IntStack` stack of `int` values: genny -in stack.go -out stack-int.go gen "Item=int" generate a `StringStack` stack of `string` values: genny -in stack.go -out stack-string.go gen "Item=string"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item generic.Type

Item the type of the stack

type ItemStack

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

ItemStack the stack of Items

func (*ItemStack) IsEmpty

func (s *ItemStack) IsEmpty() bool

IsEmpty check stack if empty

func (*ItemStack) New

func (s *ItemStack) New() *ItemStack

New creates a new ItemStack

func (*ItemStack) Pop

func (s *ItemStack) Pop() *Item

Pop removes an Item from the top of the stack

func (*ItemStack) Push

func (s *ItemStack) Push(t Item)

Push adds an Item to the top of the stack

func (*ItemStack) Top

func (s *ItemStack) Top() Item

Top view item the top of the stack

Jump to

Keyboard shortcuts

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