treeNodes

package
v0.0.0-...-239939c Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NUMBER_OBJ    = "NUMBER"
	BOOLEAN_OBJ   = "BOOLEAN"
	STRING_OBJ    = "STRING"
	BLOCK_OBJ     = "BLOCK"
	DEFERRED      = "DEFERRED"
	ARRAY_OBJ     = "ARRAY"
	UNDEFINED_OBJ = "UNDEFINED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentNode

type AssignmentNode struct {
	*ValueNode
	// contains filtered or unexported fields
}

func NewAssignmentNode

func NewAssignmentNode() *AssignmentNode

func (*AssignmentNode) Eval

func (assignment *AssignmentNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*AssignmentNode) GetValue

func (a *AssignmentNode) GetValue() ValueNodeInterface

func (*AssignmentNode) GetVariable

func (a *AssignmentNode) GetVariable() *VariableNode

func (*AssignmentNode) GetVariables

func (a *AssignmentNode) GetVariables() []string

func (*AssignmentNode) IsAssignment

func (a *AssignmentNode) IsAssignment() bool

func (*AssignmentNode) SetPosition

func (a *AssignmentNode) SetPosition(position int64)

func (*AssignmentNode) SetValue

func (a *AssignmentNode) SetValue(value ValueNodeInterface)

func (*AssignmentNode) SetVariable

func (a *AssignmentNode) SetVariable(variable *VariableNode)

type BlockNode

type BlockNode struct {
	*ValueNode
	// contains filtered or unexported fields
}

func NewBlockNode

func NewBlockNode() *BlockNode

func (*BlockNode) Eval

func (block *BlockNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*BlockNode) GetBody

func (m *BlockNode) GetBody() *SequenceNode

func (*BlockNode) GetVariables

func (m *BlockNode) GetVariables() []string

func (*BlockNode) SetArguments

func (m *BlockNode) SetArguments(arguments []*VariableNode)

func (*BlockNode) SetBar

func (m *BlockNode) SetBar(bar int64)

func (*BlockNode) SetBody

func (m *BlockNode) SetBody(body *SequenceNode)

func (*BlockNode) SetColons

func (m *BlockNode) SetColons(colons []int64)

func (*BlockNode) SetLeft

func (m *BlockNode) SetLeft(left int64)

func (*BlockNode) SetRight

func (m *BlockNode) SetRight(right int64)

type CascadeNode

type CascadeNode struct {
	*ValueNode
	// contains filtered or unexported fields
}

func NewCascadeNode

func NewCascadeNode() *CascadeNode

func (*CascadeNode) GetReceiver

func (c *CascadeNode) GetReceiver() ValueNodeInterface

func (*CascadeNode) GetVariables

func (m *CascadeNode) GetVariables() []string

func (*CascadeNode) SetMessages

func (m *CascadeNode) SetMessages(messages []*MessageNode)

func (*CascadeNode) SetSemicolons

func (m *CascadeNode) SetSemicolons(semicolons []int64)

type Deferred

type Deferred struct {
	*SmalltalkBlock
}

func NewDeferred

func NewDeferred(blockNode *BlockNode, scope *Scope) *Deferred

func (*Deferred) TypeOf

func (d *Deferred) TypeOf() string

type Interval

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

func (*Interval) SetStart

func (i *Interval) SetStart(start int64)

func (*Interval) SetStop

func (i *Interval) SetStop(stop int64)

type LiteralArrayNode

type LiteralArrayNode struct {
	*LiteralNode
	// contains filtered or unexported fields
}

func (*LiteralArrayNode) Eval

func (array *LiteralArrayNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*LiteralArrayNode) GetValue

func (l *LiteralArrayNode) GetValue() string

func (*LiteralArrayNode) GetVariables

func (m *LiteralArrayNode) GetVariables() []string

func (*LiteralArrayNode) IsLiteralArray

func (l *LiteralArrayNode) IsLiteralArray() bool

type LiteralNode

type LiteralNode struct {
	*ValueNode
}

func NewLiteralNode

func NewLiteralNode() *LiteralNode

func (*LiteralNode) IsLiteralNode

func (l *LiteralNode) IsLiteralNode() bool

func (*LiteralNode) LiteralToken

type LiteralNodeInterface

type LiteralNodeInterface interface {
	ValueNodeInterface
	LiteralToken(token scanner.LiteralTokenInterface) LiteralNodeInterface
	GetValue() string
}

func CreateLiteralArrayNode

func CreateLiteralArrayNode(startPosition int64, stopPosition int64, contents []LiteralNodeInterface) LiteralNodeInterface

type LiteralValueNode

type LiteralValueNode struct {
	*LiteralNode
	// contains filtered or unexported fields
}

func (*LiteralValueNode) Eval

func (literalValue *LiteralValueNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*LiteralValueNode) GetTypeOfToken

func (literalValue *LiteralValueNode) GetTypeOfToken() string

func (*LiteralValueNode) GetValue

func (literalValue *LiteralValueNode) GetValue() string

func (*LiteralValueNode) GetVariables

func (l *LiteralValueNode) GetVariables() []string

type MessageNode

type MessageNode struct {
	*ValueNode
	// contains filtered or unexported fields
}

func NewMessageNode

func NewMessageNode() *MessageNode

func (*MessageNode) Eval

func (message *MessageNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*MessageNode) GetArguments

func (m *MessageNode) GetArguments() []ValueNodeInterface

func (*MessageNode) GetReceiver

func (m *MessageNode) GetReceiver() ValueNodeInterface

func (*MessageNode) GetSelector

func (m *MessageNode) GetSelector() string

func (*MessageNode) GetSelectorParts

func (m *MessageNode) GetSelectorParts() []scanner.ValueTokenInterface

func (*MessageNode) GetVariables

func (m *MessageNode) GetVariables() []string

func (*MessageNode) IsMessage

func (n *MessageNode) IsMessage() bool

func (*MessageNode) SetArguments

func (m *MessageNode) SetArguments(arguments []ValueNodeInterface)

func (*MessageNode) SetReceiver

func (m *MessageNode) SetReceiver(receiver ValueNodeInterface)

func (*MessageNode) SetReceiverSelectorPartsArguments

func (m *MessageNode) SetReceiverSelectorPartsArguments(receiver ValueNodeInterface, selectorParts []scanner.ValueTokenInterface, arguments []ValueNodeInterface)

type Node

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

func (*Node) Eval

func (n *Node) Eval(scope *Scope) SmalltalkObjectInterface

func (*Node) GetLastValue

func (n *Node) GetLastValue() SmalltalkObjectInterface

func (*Node) GetParent

func (n *Node) GetParent() ProgramNodeInterface

func (*Node) IsAssignment

func (n *Node) IsAssignment() bool

func (*Node) IsLiteralArray

func (l *Node) IsLiteralArray() bool

func (*Node) IsLiteralNode

func (n *Node) IsLiteralNode() bool

func (*Node) IsMessage

func (n *Node) IsMessage() bool

func (*Node) SetLastValue

func (n *Node) SetLastValue(value SmalltalkObjectInterface)

func (*Node) SetParent

func (n *Node) SetParent(nodeInterface ProgramNodeInterface)

func (*Node) TypeOfNode

func (n *Node) TypeOfNode() string

type NodeWithRreceiverInterface

type NodeWithRreceiverInterface interface {
	GetReceiver() ValueNodeInterface
}

type ProgramNodeInterface

type ProgramNodeInterface interface {
	TypeOfNode() string
	SetParent(nodeInterface ProgramNodeInterface)
	GetParent() ProgramNodeInterface

	IsMessage() bool
	IsLiteralNode() bool
	IsLiteralArray() bool
	IsAssignment() bool
	Eval(scope *Scope) SmalltalkObjectInterface
	GetLastValue() SmalltalkObjectInterface
	SetLastValue(SmalltalkObjectInterface)
	GetVariables() []string
}

type Scope

type Scope struct {
	OuterScope *Scope
	// contains filtered or unexported fields
}

func (*Scope) FindValueByName

func (s *Scope) FindValueByName(name string) (SmalltalkObjectInterface, bool)

func (*Scope) GetVarValue

func (s *Scope) GetVarValue(name string) (SmalltalkObjectInterface, error)

func (*Scope) Initialize

func (s *Scope) Initialize() *Scope

func (*Scope) SetBoolVar

func (s *Scope) SetBoolVar(name string, value bool) *SmalltalkBoolean

func (*Scope) SetNumberVar

func (s *Scope) SetNumberVar(name string, value float64) *SmalltalkNumber

func (*Scope) SetStringVar

func (s *Scope) SetStringVar(name string, value string) *SmalltalkString

func (*Scope) SetVar

type SequenceNode

type SequenceNode struct {
	*Node
	// contains filtered or unexported fields
}

func NewSequenceNode

func NewSequenceNode() *SequenceNode

func (*SequenceNode) Eval

func (sequence *SequenceNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*SequenceNode) GetStatements

func (m *SequenceNode) GetStatements() []ProgramNodeInterface

func (*SequenceNode) GetTemporaries

func (m *SequenceNode) GetTemporaries() []*VariableNode

func (*SequenceNode) GetVariables

func (m *SequenceNode) GetVariables() []string

func (*SequenceNode) SetLeftBar

func (m *SequenceNode) SetLeftBar(leftBar int64)

func (*SequenceNode) SetPeriods

func (m *SequenceNode) SetPeriods(periods []int64)

func (*SequenceNode) SetRightBar

func (m *SequenceNode) SetRightBar(rightBar int64)

func (*SequenceNode) SetStatements

func (m *SequenceNode) SetStatements(statements []ProgramNodeInterface)

func (*SequenceNode) SetTemporaries

func (m *SequenceNode) SetTemporaries(temporaries []*VariableNode)

func (*SequenceNode) TypeOfNode

func (n *SequenceNode) TypeOfNode() string

type SmalltalkArray

type SmalltalkArray struct {
	SmalltalkObject
	// contains filtered or unexported fields
}

func (*SmalltalkArray) GetValue

func (a *SmalltalkArray) GetValue() ([]interface{}, error)

func (*SmalltalkArray) GetValueAt

func (a *SmalltalkArray) GetValueAt(index int64) SmalltalkObjectInterface

func (*SmalltalkArray) Perform

func (*SmalltalkArray) TypeOf

func (a *SmalltalkArray) TypeOf() string

func (*SmalltalkArray) Value

type SmalltalkBlock

type SmalltalkBlock struct {
	*SmalltalkObject
	// contains filtered or unexported fields
}

func (*SmalltalkBlock) Perform

func (*SmalltalkBlock) TypeOf

func (b *SmalltalkBlock) TypeOf() string

func (*SmalltalkBlock) Value

type SmalltalkBoolean

type SmalltalkBoolean struct {
	*SmalltalkObject
	// contains filtered or unexported fields
}

func NewSmalltalkBoolean

func NewSmalltalkBoolean(value bool) *SmalltalkBoolean

func (*SmalltalkBoolean) GetValue

func (b *SmalltalkBoolean) GetValue() bool

func (*SmalltalkBoolean) Perform

func (*SmalltalkBoolean) SetValue

func (b *SmalltalkBoolean) SetValue(val bool) *SmalltalkBoolean

func (*SmalltalkBoolean) TypeOf

func (b *SmalltalkBoolean) TypeOf() string

func (*SmalltalkBoolean) Value

type SmalltalkNumber

type SmalltalkNumber struct {
	*SmalltalkObject
	// contains filtered or unexported fields
}

func NewSmalltalkNumber

func NewSmalltalkNumber(value float64) *SmalltalkNumber

func (*SmalltalkNumber) GetValue

func (n *SmalltalkNumber) GetValue() float64

func (*SmalltalkNumber) Perform

func (*SmalltalkNumber) SetValue

func (n *SmalltalkNumber) SetValue(val float64) *SmalltalkNumber

func (*SmalltalkNumber) TypeOf

func (n *SmalltalkNumber) TypeOf() string

func (*SmalltalkNumber) Value

type SmalltalkObject

type SmalltalkObject struct {
}

func (*SmalltalkObject) Perform

type SmalltalkObjectInterface

type SmalltalkObjectInterface interface {
	TypeOf() string
	Perform(name string, params []SmalltalkObjectInterface) (SmalltalkObjectInterface, error)
	Value() SmalltalkObjectInterface
}

func Call

func Call(receiver SmalltalkObjectInterface, m map[string]interface{}, name string, params []SmalltalkObjectInterface) (SmalltalkObjectInterface, error)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func ValueAt

func ValueAt(receiver *SmalltalkArray, index *SmalltalkNumber) SmalltalkObjectInterface

Array methods

type SmalltalkString

type SmalltalkString struct {
	*SmalltalkObject
	// contains filtered or unexported fields
}

func NewSmalltalkString

func NewSmalltalkString(value string) *SmalltalkString

func (*SmalltalkString) GetValue

func (s *SmalltalkString) GetValue() string

func (*SmalltalkString) SetValue

func (s *SmalltalkString) SetValue(val string) *SmalltalkString

func (*SmalltalkString) TypeOf

func (s *SmalltalkString) TypeOf() string

func (*SmalltalkString) Value

type SmalltalkUndefinedObject

type SmalltalkUndefinedObject struct {
	*SmalltalkObject
}

func NewSmalltalkUndefinedObject

func NewSmalltalkUndefinedObject() *SmalltalkUndefinedObject

func (*SmalltalkUndefinedObject) Perform

func (*SmalltalkUndefinedObject) TypeOf

func (n *SmalltalkUndefinedObject) TypeOf() string

func (*SmalltalkUndefinedObject) Value

type ValueNode

type ValueNode struct {
	*Node
	// contains filtered or unexported fields
}

func NewValueNode

func NewValueNode() *ValueNode

func (*ValueNode) AddParenthesis

func (v *ValueNode) AddParenthesis(interval Interval)

type ValueNodeInterface

type ValueNodeInterface interface {
	ProgramNodeInterface
	AddParenthesis(interval Interval)
}

type VariableNode

type VariableNode struct {
	*ValueNode
	Token scanner.ValueTokenInterface
}

func (*VariableNode) Eval

func (variable *VariableNode) Eval(scope *Scope) SmalltalkObjectInterface

func (*VariableNode) GetName

func (v *VariableNode) GetName() string

func (*VariableNode) GetVariables

func (m *VariableNode) GetVariables() []string

Jump to

Keyboard shortcuts

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