convert

package
v0.0.0-...-863e8e2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package convert helps to convert go/ast to mapast

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversion

type Conversion struct {
	AstTree      map[uint64][]byte
	MyFile       uint64
	EnderSepared [2]map[int]struct{}
	Comments1    bool
	// contains filtered or unexported fields
}

Conversion holds the state of translation of a single file. Please put your ast tree map to AstTree field and the key of your file to the MyFile field. Conversion is usually not reused.

func NewConversion

func NewConversion(asttree map[uint64][]byte, whichfile uint64, file []byte) *Conversion

NewConversion creates a new conversion for a source file. Whichfile is the number of file to be translated, starting from zero. File is the slice filled with the source code, used to scan for comments info.

func (*Conversion) Visit

func (c *Conversion) Visit(x ast.Node) ast.Visitor

Visit is the main function used to translate go/ast to mapast. Visit is not called directly, but instead the Conversion is passed to the ast.Walk call.

Jump to

Keyboard shortcuts

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