tc2

package module
v0.0.0-...-70fd630 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README

tc2

Next major release of ThreadComputation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Callbacks cmap.Cmap
View Source
var ExpressionCBChain deque.Deque[interface{}]
View Source
var Functions cmap.Cmap
View Source
var VERSION = "2.00"

Functions

func InitExitCallbacks

func InitExitCallbacks(tc *TCstate)

func TCExitCbPoolClose

func TCExitCbPoolClose(l *TCExecListener)

func TCExitCbSetExitError

func TCExitCbSetExitError(l *TCExecListener)

Types

type TCError

type TCError struct {
	Msg   string
	Attrs cmap.Cmap
	Err   error
}

func MakeError

func MakeError(err interface{}, args ...interface{}) *TCError

func (*TCError) Error

func (e *TCError) Error() string

func (*TCError) String

func (e *TCError) String() string

func (*TCError) Unix

func (e *TCError) Unix() int64

type TCExecListener

type TCExecListener struct {
	*parser.BaseBundParserListener
	TC *TCstate
}

func (*TCExecListener) EnterExpression

func (tc *TCExecListener) EnterExpression(ctx *parser.ExpressionContext)

func (*TCExecListener) EnterFunction_declaration

func (tc *TCExecListener) EnterFunction_declaration(ctx *parser.Function_declarationContext)

func (*TCExecListener) EnterNs_declaration

func (tc *TCExecListener) EnterNs_declaration(ctx *parser.Ns_declarationContext)

func (*TCExecListener) ExitExpression

func (tc *TCExecListener) ExitExpression(ctx *parser.ExpressionContext)

func (*TCExecListener) ExitFunction_declaration

func (tc *TCExecListener) ExitFunction_declaration(ctx *parser.Function_declarationContext)

func (*TCExecListener) ExitNs_declaration

func (tc *TCExecListener) ExitNs_declaration(ctx *parser.Ns_declarationContext)

func (*TCExecListener) ExitRequest

func (l *TCExecListener) ExitRequest()

func (*TCExecListener) ExitRequested

func (l *TCExecListener) ExitRequested() bool

func (*TCExecListener) RegisterExitCallback

func (l *TCExecListener) RegisterExitCallback(name string, fun TCExitCbFun)

func (*TCExecListener) RunExitCallbacks

func (l *TCExecListener) RunExitCallbacks()

func (*TCExecListener) SetError

func (l *TCExecListener) SetError(msg string, args ...interface{})

type TCExitCbFun

type TCExitCbFun func(*TCExecListener)

type TCExtType

type TCExtType func(interface{}) int

type TCExtTypeStr

type TCExtTypeStr func(interface{}) string

type TCstate

type TCstate struct {
	ID string

	HandleErr bool
	ErrStack  deque.Deque[interface{}] // Stack of errors

	Res        *TwoStack                // main stack
	ResNames   deque.Deque[interface{}] // stack of stack names
	ResN       mapset.Set               // set of stack names
	StackList  cmap.Cmap                // Reference to stacks
	StackChan  cmap.Cmap                // Reference to stack channels
	Vars       cmap.Cmap                // variables
	Functions  cmap.Cmap                // Functions
	UFunctions cmap.Cmap                // User Functions
	UMacros    cmap.Cmap                // User Macros
	FCStack    deque.Deque[string]      // Function call stack
	CodeStack  deque.Deque[string]      // Accumulation for codeblocks
	FCodeStack deque.Deque[string]      // Accumulation for function code
	MCodeStack deque.Deque[string]      // Accumulation for macro code
	Ctx        cmap.Cmap                // Global context
	CtxStack   deque.Deque[interface{}] // Stack of local contexts
	Wg         sync.WaitGroup           // Global wait group
	Pool       *gohive.PoolService      // Global execution pool
	ExReq      chan bool                // Exit request channel
	IsExitReq  bool                     // Exit flag
	ExitCb     *dict.Dict               // Exit callbacks
	// contains filtered or unexported fields
}

func Init

func Init() *TCstate

func (*TCstate) AddNewStack

func (tc *TCstate) AddNewStack(name string)

func (*TCstate) ClearErrors

func (tc *TCstate) ClearErrors()

func (*TCstate) Debug

func (tc *TCstate) Debug(msg ...interface{})

func (*TCstate) Debugf

func (tc *TCstate) Debugf(msg string, args ...interface{})

func (*TCstate) DelStack

func (tc *TCstate) DelStack(name string)

func (*TCstate) DropLastStack

func (tc *TCstate) DropLastStack() error

func (*TCstate) Error

func (tc *TCstate) Error() string

func (*TCstate) Errors

func (tc *TCstate) Errors() int

func (*TCstate) Eval

func (tc *TCstate) Eval(code string) *TCstate

func (*TCstate) ExitRequested

func (tc *TCstate) ExitRequested() bool

func (*TCstate) GetVariable

func (tc *TCstate) GetVariable(name string) (interface{}, error)

func (*TCstate) GoEval

func (tc *TCstate) GoEval(code string) *TCstate

func (*TCstate) HasVariable

func (tc *TCstate) HasVariable(name string) bool

func (*TCstate) MakeError

func (tc *TCstate) MakeError(err interface{}, args ...interface{}) *TCError

func (*TCstate) PositionStack

func (tc *TCstate) PositionStack(name string) error

func (*TCstate) RegisterError

func (tc *TCstate) RegisterError(err *TCError)

func (*TCstate) RegisterExitCallback

func (tc *TCstate) RegisterExitCallback(name string, fun TCExitCbFun)

func (*TCstate) RotateStackNames

func (tc *TCstate) RotateStackNames()

func (*TCstate) SetError

func (tc *TCstate) SetError(msg string, args ...interface{})

func (*TCstate) SetVariable

func (tc *TCstate) SetVariable(name string, data interface{})

func (*TCstate) StackLeft

func (tc *TCstate) StackLeft(n int)

func (*TCstate) StackRight

func (tc *TCstate) StackRight(n int)

func (*TCstate) StacksLeft

func (tc *TCstate) StacksLeft(n int)

func (*TCstate) StacksRight

func (tc *TCstate) StacksRight(n int)

func (*TCstate) TrueErrors

func (tc *TCstate) TrueErrors() int

type TwoStack

type TwoStack struct {
	R deque.Deque[interface{}]
	C cmap.Cmap

	ID     string
	Status bool
	Mode   bool
	// contains filtered or unexported fields
}

func InitTS

func InitTS(tc *TCstate) *TwoStack

Initialize new 2-dimentional stack structure

func (*TwoStack) Add

func (ts *TwoStack) Add()

func (*TwoStack) CLeft

func (ts *TwoStack) CLeft()

func (*TwoStack) CRight

func (ts *TwoStack) CRight()

func (*TwoStack) Del

func (ts *TwoStack) Del()

func (*TwoStack) Front

func (ts *TwoStack) Front() interface{}

func (*TwoStack) GLen

func (ts *TwoStack) GLen() int

func (*TwoStack) Get

func (ts *TwoStack) Get() (interface{}, error)

func (*TwoStack) Left

func (ts *TwoStack) Left()

func (*TwoStack) Len

func (ts *TwoStack) Len() int

func (*TwoStack) Normal

func (ts *TwoStack) Normal()

func (*TwoStack) PopFront

func (ts *TwoStack) PopFront() interface{}

func (*TwoStack) Q

func (ts *TwoStack) Q() *deque.Deque[interface{}]

func (*TwoStack) Reverse

func (ts *TwoStack) Reverse()

func (*TwoStack) Right

func (ts *TwoStack) Right()

func (*TwoStack) Set

func (ts *TwoStack) Set(data interface{})

func (*TwoStack) Take

func (ts *TwoStack) Take() (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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