Documentation

Overview

Package codegen implements utilities for VDL code generators. Code generators for specific languages live in sub-directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Import

type Import struct {
	Name string // Name of the import; may be empty.
	Path string // Path of the imported package; e.g. "v.io/x/ref/lib/vdl/testdata/arith"

	// Local name that refers to the imported package; either the non-empty import
	// name, or the name of the imported package.
	Local string
}

Import represents a single package import.

type Imports

type Imports []Import

Imports is a collection of package imports. REQUIRED: The imports must be sorted by path.

func ImportsForFiles

func ImportsForFiles(files ...*compile.File) Imports

ImportsForFiles returns the imports required for the given files.

func ImportsForValue

func ImportsForValue(v *vdl.Value, pkgPath string) Imports

ImportsForValue returns the imports required to represent the given value v, from within the given pkgPath. It requires that type names used in v are of the form "PKGPATH.NAME".

func (Imports) LookupLocal

func (x Imports) LookupLocal(pkgPath string) string

LookupLocal returns the local name that identifies the given pkgPath.

Source Files

Directories

Path Synopsis
golang Package golang implements Go code generation from compiled VDL packages.
java Package java implements Java code generation from compiled VDL packages.
javascript Package javascript implements Javascript code generation from compiled VDL packages.
json Package json implements JSON generation for VDL const values.
swift Package swift implements Swift code generation from compiled VDL packages.
vdlgen Package vdlgen implements VDL code generation from compiled VDL packages.