xrefs

package
v0.0.0-...-62694dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package xrefs provides support for local xrefs. For example, it resolves symbols in a single Java file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	SymbolTables map[ast.Node]*SymbolTable
	// contains filtered or unexported fields
}

Resolver resolves symbols in a Java program. Each identifier is mapped to the ast.Node that defined it.

func NewResolver

func NewResolver(tree *ast.Tree) *Resolver

NewResolver returns a new Resolver based on an AST.

func (*Resolver) Resolve

func (r *Resolver) Resolve() map[ast.Node]ast.Node

Resolve maps symbols in the AST to the nodes that define them. For example, a field in an expression will be mapped to the field definition node.

type SymbolTable

type SymbolTable struct {
	Types   map[string]ast.Node   // <- interfaces, enums, classes, etc.
	Members map[string][]ast.Node // <- overloaded functions + fields with this name
}

SymbolTable describes what's in a container node, such as a class, enum, interface, method, etc.

Jump to

Keyboard shortcuts

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