types

package
v0.0.0-...-d69f115 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// package name
	PackageName string
	// file
	FileName string
	// per file symbol table
	SymbolTable *stack.Stack
	// per subset of packages symbol table
	GlobalSymbolTable *global.Table
	// per file allocatable ST
	AllocatedSymbolsTable *alloctable.Table
	// types parser
	TypeParser TypeParser
	// expresesion parser
	ExprParser ExpressionParser
	IsConst    bool
	Iota       uint
	// statement parser
	StmtParser StatementParser
	// per-file contract table
	ContractTable *contracttable.Table
	// symbols accessor
	SymbolsAccessor *accessors.Accessor
}

Config for a parser

func (*Config) SymbolPos

func (c *Config) SymbolPos(pos token.Pos) string

type ConstSpec

type ConstSpec struct {
	IotaIdx uint
	Spec    *ast.ValueSpec
}

type ExprAttribute

type ExprAttribute struct {
	DataTypeList []gotypes.DataType
	TypeVarList  []typevars.Interface
}

func ExprAttributeFromDataType

func ExprAttributeFromDataType(list ...gotypes.DataType) *ExprAttribute

func (*ExprAttribute) AddTypeVar

func (e *ExprAttribute) AddTypeVar(typevar typevars.Interface) *ExprAttribute

type ExpressionParser

type ExpressionParser interface {
	Parse(expr ast.Expr) (*ExprAttribute, error)
}

ExpressionParser implemenation is responsible for Go expression parsing/processing

type StatementParser

type StatementParser interface {
	// Parse a general statement (there are no particular variables attached to the statement)
	Parse(statement ast.Stmt) error
	// ParseFuncDecl parses function declaration only
	ParseFuncDecl(d *ast.FuncDecl) (gotypes.DataType, error)
	// ParseFuncBody parses function body with pushing function parameter(s) and/or its receiver into the symbol table
	ParseFuncBody(funcDecl *ast.FuncDecl) error
	// ParseValueSpec parses variable definition/declaration
	ParseValueSpec(spec *ast.ValueSpec) ([]*symbols.SymbolDef, error)
	// ParseValueSpec parses constant definition/declaration
	ParseConstValueSpec(spec ConstSpec) ([]*symbols.SymbolDef, error)
}

StatementParser implemenation is responsible for: - statement parsing/processing (block is considered a statement) -

type TypeParser

type TypeParser interface {
	Parse(d ast.Expr) (gotypes.DataType, error)
}

TypeParser implementation is responsible for Go data type parsing/processing

Jump to

Keyboard shortcuts

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