analyzer

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assignments = make(map[string]Assignment)
View Source
var Events = make(map[string]Event)
View Source
var ExprFuncCalls = make(map[string]ExprFuncCall)
View Source
var FuncCalls = make(map[string]FuncCall)
View Source
var Variables = make(map[string]Var)

Functions

func CalculateConstants

func CalculateConstants(statements []parser.Stmt, definitions Definitions) (errors []error, warnings []error)

Types

type AnalyzerError

type AnalyzerError struct {
	Start   parser.Position
	End     parser.Position
	Message string
	Warning bool
}

func (AnalyzerError) Error

func (e AnalyzerError) Error() string

type AnalyzerResult

type AnalyzerResult struct {
	Definitions Definitions
	Warnings    []error
	Errors      []error
}

func Analyze

func Analyze(statements []parser.Stmt) ([]parser.Stmt, AnalyzerResult)

type Assignment

type Assignment struct {
	Name         string
	DataType     parser.DataType
	AssignType   blocks.BlockType
	IncreaseType blocks.BlockType
	InputName    string
}

func (Assignment) String

func (a Assignment) String() string

type Constant

type Constant struct {
	Name      parser.Token
	ValueExpr parser.Expr
	Value     any
	Type      parser.DataType
	// contains filtered or unexported fields
}

type CustomEvent

type CustomEvent struct {
	ID   string
	Name parser.Token
	// contains filtered or unexported fields
}

type Definitions

type Definitions struct {
	Variables map[string]*Variable
	Lists     map[string]*List
	Constants map[string]*Constant
	Functions map[string]*Function
	Events    map[string]*CustomEvent
}

type Event

type Event struct {
	Name         string
	Param        *Param
	ParamOptions []any
}

func (Event) String

func (e Event) String() string

type ExprFuncCall

type ExprFuncCall struct {
	Name       string
	Signatures []Signature
}

type FuncCall

type FuncCall struct {
	Name       string
	Signatures []Signature
}

type Function

type Function struct {
	Name        parser.Token
	Params      []parser.FuncParam
	ProcCode    string
	ArgumentIDs []string
	StartLine   int
	EndLine     int
	// contains filtered or unexported fields
}

type List

type List struct {
	ID       string
	Name     parser.Token
	DataType parser.DataType
	// contains filtered or unexported fields
}

type Param

type Param struct {
	Name string
	Type parser.DataType
}

type Signature

type Signature struct {
	FuncName   string
	Params     []Param
	ReturnType parser.DataType
}

func (Signature) String

func (s Signature) String() string

type Var

type Var struct {
	Name     string
	DataType parser.DataType
}

func (Var) String

func (v Var) String() string

type Variable

type Variable struct {
	ID       string
	Name     parser.Token
	DataType parser.DataType
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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