solver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExprType

func ExprType(sc *meta.Scope, cs *meta.ClassParseState, n node.Node) meta.TypesMap

ExprType returns type of expression. Depending on whether or not is it "full mode", it will also recursively resolve all nested types

func ExprTypeCustom

func ExprTypeCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap

ExprTypeCustom is ExprType that allows to specify custom types overrides

func ExprTypeLocal

func ExprTypeLocal(sc *meta.Scope, cs *meta.ClassParseState, n node.Node) meta.TypesMap

ExprTypeLocal is basic expression type that does not resolve cross-file function calls and such

func ExprTypeLocalCustom

func ExprTypeLocalCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap

ExprTypeLocalCustom is ExprTypeLocal that allows to specify custom types

func FindConstant

func FindConstant(className string, constName string) (res meta.ConstantInfo, implClassName string, ok bool)

FindConstant searches for a costant in specified class and returns actual class that contains the constant.

func FindMethod

func FindMethod(className string, methodName string) (res meta.FuncInfo, implClassName string, ok bool)

FindMethod searches for a method in specified class

func FindProperty

func FindProperty(className string, propertyName string) (res meta.PropertyInfo, implClassName string, ok bool)

FindProperty searches for a property in specified class (both static and instance properties)

func GetClassName

func GetClassName(cs *meta.ClassParseState, classNode node.Node) (className string, ok bool)

GetClassName resolves class name for specified class node (as used in static calls, property fetch, etc)

func GetConstant

func GetConstant(cs *meta.ClassParseState, constNode node.Node) (constName string, ci meta.ConstantInfo, ok bool)

GetConstant searches for specified constant in const fetch.

func Implements

func Implements(className string, interfaceName string) bool

Implements checks if className implements interfaceName

func ResolveTypes

func ResolveTypes(curStaticClass string, m meta.TypesMap, visitedMap map[string]struct{}) map[string]struct{}

ResolveTypes resolves function calls, method calls and global variables.

curStaticClass is current class name (if inside the class, otherwise "")

Types

type CustomType

type CustomType struct {
	Node node.Node
	Typ  meta.TypesMap
}

CustomType specifies a mapping between some AST structure and concrete type (e.g. for <expr> instanceof <something>)

Jump to

Keyboard shortcuts

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