nsresolver

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package visitor contains walker.visitor implementations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

type Namespace struct {
	Namespace string
	Aliases   map[string]map[string]string
}

Namespace context

func NewNamespace

func NewNamespace(NSName string) *Namespace

NewNamespace constructor

func (*Namespace) AddAlias

func (ns *Namespace) AddAlias(aliasType string, aliasName string, alias string)

AddAlias adds a new alias

func (*Namespace) ResolveAlias

func (ns *Namespace) ResolveAlias(nameNode ast.Vertex, aliasType string) (string, error)

ResolveAlias returns alias or error if not found

func (*Namespace) ResolveName

func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string, error)

ResolveName returns a resolved fully qualified name

type NamespaceResolver

type NamespaceResolver struct {
	visitor.Null
	Namespace     *Namespace
	ResolvedNames map[ast.Vertex]string
	// contains filtered or unexported fields
}

NamespaceResolver visitor

func NewNamespaceResolver

func NewNamespaceResolver() *NamespaceResolver

NewNamespaceResolver NamespaceResolver type constructor

func (*NamespaceResolver) AddAlias

func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex)

AddAlias adds a new alias

func (*NamespaceResolver) AddNamespacedName

func (nsr *NamespaceResolver) AddNamespacedName(nn ast.Vertex, nodeName string)

AddNamespacedName adds namespaced name by node

func (*NamespaceResolver) EnterNode

func (nsr *NamespaceResolver) EnterNode(n ast.Vertex) bool

func (*NamespaceResolver) ExprClassConstFetch

func (nsr *NamespaceResolver) ExprClassConstFetch(n *ast.ExprClassConstFetch)

func (*NamespaceResolver) ExprClosure

func (nsr *NamespaceResolver) ExprClosure(n *ast.ExprClosure)

func (*NamespaceResolver) ExprConstFetch

func (nsr *NamespaceResolver) ExprConstFetch(n *ast.ExprConstFetch)

func (*NamespaceResolver) ExprFunctionCall

func (nsr *NamespaceResolver) ExprFunctionCall(n *ast.ExprFunctionCall)

func (*NamespaceResolver) ExprInstanceOf

func (nsr *NamespaceResolver) ExprInstanceOf(n *ast.ExprInstanceOf)

func (*NamespaceResolver) ExprNew

func (nsr *NamespaceResolver) ExprNew(n *ast.ExprNew)

func (*NamespaceResolver) ExprStaticCall

func (nsr *NamespaceResolver) ExprStaticCall(n *ast.ExprStaticCall)

func (*NamespaceResolver) ExprStaticPropertyFetch

func (nsr *NamespaceResolver) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch)

func (*NamespaceResolver) LeaveNode

func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex)

LeaveNode is invoked after node process

func (*NamespaceResolver) ResolveName

func (nsr *NamespaceResolver) ResolveName(nameNode ast.Vertex, aliasType string)

ResolveName adds a resolved fully qualified name by node

func (*NamespaceResolver) ResolveType

func (nsr *NamespaceResolver) ResolveType(n ast.Vertex)

ResolveType adds a resolved fully qualified type name

func (*NamespaceResolver) StmtCatch

func (nsr *NamespaceResolver) StmtCatch(n *ast.StmtCatch)

func (*NamespaceResolver) StmtClass

func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass)

func (*NamespaceResolver) StmtClassMethod

func (nsr *NamespaceResolver) StmtClassMethod(n *ast.StmtClassMethod)

func (*NamespaceResolver) StmtConstList

func (nsr *NamespaceResolver) StmtConstList(n *ast.StmtConstList)

func (*NamespaceResolver) StmtFunction

func (nsr *NamespaceResolver) StmtFunction(n *ast.StmtFunction)

func (*NamespaceResolver) StmtGroupUse

func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUseList)

func (*NamespaceResolver) StmtInterface

func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface)

func (*NamespaceResolver) StmtNamespace

func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace)

func (*NamespaceResolver) StmtPropertyList

func (nsr *NamespaceResolver) StmtPropertyList(n *ast.StmtPropertyList)

func (*NamespaceResolver) StmtTrait

func (nsr *NamespaceResolver) StmtTrait(n *ast.StmtTrait)

func (*NamespaceResolver) StmtTraitUse

func (nsr *NamespaceResolver) StmtTraitUse(n *ast.StmtTraitUse)

func (*NamespaceResolver) StmtUse

func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUseList)

Jump to

Keyboard shortcuts

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