pos

package
v0.0.0-...-d977049 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package pos implements the position of a lexical dotted item

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

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

Pos contains the position of a lexical Item

func From

func From(stack []int) *Pos

From returns a Pos derived from the position stack, `stack`

func New

func New() *Pos

New returns a new position before the first symbol

func (*Pos) Clone

func (pos *Pos) Clone() *Pos

Clone returns a deep copy of pos

func (*Pos) Equal

func (pos *Pos) Equal(other *Pos) bool

Equal is true if the two stacks are the same

func (*Pos) Inc

func (pos *Pos) Inc() *Pos

Inc increments the value of pos.Top(). It returns pos for command chaining

func (*Pos) Len

func (pos *Pos) Len() int

Len returns the number of items on the stack

func (*Pos) Peek

func (pos *Pos) Peek(height int) int

Peek returns the value of the item at height above the bottom of the stack. Pos remains unmodified

func (*Pos) Pop

func (pos *Pos) Pop(n int) *Pos

Pop removes the top n elements from the stack. Pop returns a self pointer for command chaining.

func (*Pos) Push

func (pos *Pos) Push(p int) *Pos

Push pushes p onto the stack and returns a pointer to itself for command chainging.

func (*Pos) String

func (pos *Pos) String() string

func (*Pos) Tail

func (pos *Pos) Tail() *Pos

func (*Pos) Top

func (pos *Pos) Top() int

Top returns the value at the top of the stack without changing the stack

Jump to

Keyboard shortcuts

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