stack

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

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

func NewFrame

func NewFrame(opts FrameOpts) *Frame

func (*Frame) Name

func (f *Frame) Name() string

func (*Frame) Scope

func (f *Frame) Scope() *scope.Scope

func (*Frame) Statement

func (f *Frame) Statement() ast.Statement

type FrameOpts

type FrameOpts struct {
	Name      string
	Statement ast.Statement
	Scope     *scope.Scope
}

type Stack

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

Stack represents the call stack of a Tamarin program. Push and Pop are called to add and remove frames from the stack, respectively.

func New

func New() *Stack

New returns a new Stack.

func (*Stack) Pop

func (s *Stack) Pop() *Frame

Pop removes the top frame from the stack and returns it.

func (*Stack) Push

func (s *Stack) Push(f *Frame)

Push adds a new frame to the stack.

func (*Stack) Size

func (s *Stack) Size() int

Size returns the number of frames on the stack.

func (*Stack) String

func (s *Stack) String() string

func (*Stack) Top

func (s *Stack) Top() *Frame

Top returns the top frame on the stack without removing it.

func (*Stack) TrackStatement

func (s *Stack) TrackStatement(statement ast.Statement, sc *scope.Scope) *Frame

TrackStatement is used to mark the statement being executed in the current frame

Jump to

Keyboard shortcuts

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