ast

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 0 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenerInterface

type ListenerInterface interface {
	EnterNode(Node)
	ExitNode(Node)
}

type Node

type Node interface {
	String() string
	GetChildren() []Node
}

The base Node interface which represents abstract syntac trees

type Stack

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

func NewStack

func NewStack() *Stack

Create a new Stack

func (*Stack) Len

func (s *Stack) Len() int

Len return the number of items in the Stack

func (*Stack) Peek

func (s *Stack) Peek() interface{}

Peek views the top item on the Stack

func (*Stack) Pop

func (s *Stack) Pop() interface{}

Pop the top item of the Stack and return it

func (*Stack) Push

func (s *Stack) Push(value interface{})

Push a value onto the top of the Stack

type TreeWalker

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

func CreateTreeWalker

func CreateTreeWalker(listener ListenerInterface) TreeWalker

func (TreeWalker) Walk

func (w TreeWalker) Walk(node Node)

Jump to

Keyboard shortcuts

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