autoit

package module
v0.0.0-...-b6e6697 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MPL-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoItVM

type AutoItVM struct {
	//Runtime configuration
	Logger bool
	// contains filtered or unexported fields
}

func NewAutoItScriptVM

func NewAutoItScriptVM(scriptPath string, script []byte, parentScope *AutoItVM) (*AutoItVM, error)

func NewAutoItTokenVM

func NewAutoItTokenVM(scriptPath string, tokens []*Token, parentScope *AutoItVM) (*AutoItVM, error)

func (*AutoItVM) AddHandle

func (vm *AutoItVM) AddHandle(value interface{}) string

AddHandle creates a handle from the given token and returns the handle id

func (*AutoItVM) DestroyHandle

func (vm *AutoItVM) DestroyHandle(handleId string)

DestroyHandle destroys the given handle id

func (*AutoItVM) Error

func (vm *AutoItVM) Error(format string, params ...interface{}) error

func (*AutoItVM) ExtendVM

func (vm *AutoItVM) ExtendVM(tokens []*Token) (*AutoItVM, error)

func (*AutoItVM) GetError

func (vm *AutoItVM) GetError() int

func (*AutoItVM) GetExtended

func (vm *AutoItVM) GetExtended() int

func (*AutoItVM) GetHandle

func (vm *AutoItVM) GetHandle(handleId string) interface{}

GetHandle returns the token for the specified handle or nil if it doesn't exist

func (*AutoItVM) GetMacro

func (vm *AutoItVM) GetMacro(macro string) (*Token, error)

func (*AutoItVM) GetReturnValue

func (vm *AutoItVM) GetReturnValue() *Token

func (*AutoItVM) GetVariable

func (vm *AutoItVM) GetVariable(variableName string) *Token

GetVariable returns the token for the specified variable or nil if it doesn't exist

func (*AutoItVM) HandleFunc

func (vm *AutoItVM) HandleFunc(funcName string, args []*Token) (*Token, error)

func (*AutoItVM) Log

func (vm *AutoItVM) Log(format string, params ...interface{})

func (*AutoItVM) Move

func (vm *AutoItVM) Move(pos int)

func (*AutoItVM) Preprocess

func (vm *AutoItVM) Preprocess() error

Preprocess steps through the script and prepares it for execution

func (*AutoItVM) PreprocessFunc

func (vm *AutoItVM) PreprocessFunc() (string, *Function, error)

PreprocessFunc reads and processes a function

func (*AutoItVM) ReadToken

func (vm *AutoItVM) ReadToken() *Token

func (*AutoItVM) Resume

func (vm *AutoItVM) Resume()

func (*AutoItVM) Run

func (vm *AutoItVM) Run() error

func (*AutoItVM) Running

func (vm *AutoItVM) Running() bool

func (*AutoItVM) SetError

func (vm *AutoItVM) SetError(error int)

func (*AutoItVM) SetExtended

func (vm *AutoItVM) SetExtended(extended int)

func (*AutoItVM) SetReturnValue

func (vm *AutoItVM) SetReturnValue(returnValue *Token)

func (*AutoItVM) SetVariable

func (vm *AutoItVM) SetVariable(variableName string, token *Token)

SetVariable sets the specified variable to the given token

func (*AutoItVM) Stderr

func (vm *AutoItVM) Stderr() string

func (*AutoItVM) Stdout

func (vm *AutoItVM) Stdout() string

func (*AutoItVM) Step

func (vm *AutoItVM) Step() error

func (*AutoItVM) Stop

func (vm *AutoItVM) Stop()

func (*AutoItVM) Suspend

func (vm *AutoItVM) Suspend()

func (*AutoItVM) Suspended

func (vm *AutoItVM) Suspended() bool

func (*AutoItVM) Token

func (vm *AutoItVM) Token() *Token

func (*AutoItVM) Tokens

func (vm *AutoItVM) Tokens() []*Token

type Evaluator

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

func NewEvaluator

func NewEvaluator(vm *AutoItVM, tokens []*Token) *Evaluator

func (*Evaluator) Eval

func (e *Evaluator) Eval(expectValue bool) (*Token, int, error)

type Function

type Function struct {
	Args  []*FunctionArg                                     //Ordered list of arguments for calls
	Func  func(*AutoItVM, map[string]*Token) (*Token, error) //Stores a Go func binding for calls
	Block []*Token                                           //Stores a token block to step on calls
}

type FunctionArg

type FunctionArg struct {
	Name         string //Accessed by function block as $Name
	DefaultValue *Token //leave nil to require
}

type Lexer

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

func NewLexer

func NewLexer(script []byte) *Lexer

func NewLexerFromFile

func NewLexerFromFile(path string) (*Lexer, error)

func (*Lexer) GetTokens

func (l *Lexer) GetTokens() ([]*Token, error)

func (*Lexer) Move

func (l *Lexer) Move(pos int)

func (*Lexer) ReadBinary

func (l *Lexer) ReadBinary() (string, error)

func (*Lexer) ReadFlag

func (l *Lexer) ReadFlag() string

func (*Lexer) ReadIdent

func (l *Lexer) ReadIdent() string

func (*Lexer) ReadNumber

func (l *Lexer) ReadNumber() (string, error)

func (*Lexer) ReadRune

func (l *Lexer) ReadRune() (rune, error)

func (*Lexer) ReadToken

func (l *Lexer) ReadToken() (*Token, error)

func (*Lexer) ReadUntil

func (l *Lexer) ReadUntil(r rune, escapable bool) string

type Token

type Token struct {
	Type       TokenType //Type of the token
	Data       string    //String representing the token
	LineNumber int       //Starts from 0
	LinePos    int       //Starts from 0
}

func NewToken

func NewToken(tType TokenType, data interface{}) *Token

func (*Token) Bool

func (t *Token) Bool() bool

func (*Token) Bytes

func (t *Token) Bytes() []byte

func (*Token) Float64

func (t *Token) Float64() float64

func (*Token) Int

func (t *Token) Int() int

func (*Token) Int64

func (t *Token) Int64() int64

func (*Token) IsEmpty

func (t *Token) IsEmpty() bool

func (*Token) String

func (t *Token) String() string

type TokenType

type TokenType string

type Var

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

type VarType

type VarType int
const (
	VarTypeInteger VarType = iota + 1
	VarTypeBoolean
	VarTypeString
	VarTypeFloat
	VarTypeArray
	VarTypeMap
	VarTypeBinary
	VarTypePointer
	VarTypeObject
	VarTypeStruct
	VarTypeFunction
)

Jump to

Keyboard shortcuts

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