parse

package
v0.0.0-...-4f521ff Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetElems

func GetElems(filename string) ([]gen.Elem, string, error)

GetElems creates a FileSet from 'filename' and returns the processed elements.

Types

type FileSet

type FileSet struct {
	Package    string                   // package name
	Specs      []*ast.TypeSpec          // type specs in file
	Directives []string                 // preprocessor directives
	Identities map[string]gen.Primitive // alias types (e.g. type Flag uint32)
	// contains filtered or unexported fields
}

A FileSet is the in-memory representation of a parsed file. The same FileSet will always generate the same element (gen.Elem) set.

func File

func File(name string) (*FileSet, error)

File parses a file at the relative path provided and produces a new *FileSet. (No exported structs is considered an error.)

func (*FileSet) ApplyDirectives

func (f *FileSet) ApplyDirectives()

ApplyDirectives applies all of the preprocessor directives to the file set in the order that they appear in the source file.

func (*FileSet) Process

func (f *FileSet) Process() []gen.Elem

Process processes the file set into generator "trees" that can be used for code generation.

Jump to

Keyboard shortcuts

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