v.io: v.io/x/ref/lib/vdl/codegen/vdlgen Index | Files

package vdlgen

import "v.io/x/ref/lib/vdl/codegen/vdlgen"

Package vdlgen implements VDL code generation from compiled VDL packages.

Index

Package Files

const.go import.go signature.go type.go

func BaseType Uses

func BaseType(t *vdl.Type, pkgPath string, imports codegen.Imports) string

BaseType returns the base type of t using VDL syntax, where the base type is the type of t disregarding its name. Subtypes contained in t are output via calls to Type.

func Imports Uses

func Imports(imports codegen.Imports) string

Imports returns the vdl imports clause corresponding to imports; empty if there are no imports.

func PrintEmbed Uses

func PrintEmbed(w io.Writer, x signature.Embed)

PrintEmbed pretty-prints x to w.

func PrintInterface Uses

func PrintInterface(w io.Writer, x signature.Interface, types *NamedTypes)

PrintInterface pretty-prints x to w. The types are used to collect named types, so that they may be printed later.

func PrintMethod Uses

func PrintMethod(w io.Writer, x signature.Method, types *NamedTypes)

PrintMethod pretty-prints x to w. The types are used to collect named types, so that they may be printed later.

func Type Uses

func Type(t *vdl.Type, pkgPath string, imports codegen.Imports) string

Type returns t using VDL syntax, returning the qualified name if t is named, otherwise returning the base type of t. The pkgPath and imports are used to determine the local package qualifier to add to named types; if a local package qualifier cannot be found, a full package path qualifier is added.

func TypedConst Uses

func TypedConst(v *vdl.Value, pkgPath string, imports codegen.Imports) string

TypedConst returns the explicitly-typed vdl const corresponding to v, in the given pkgPath, with the given imports.

func UntypedConst Uses

func UntypedConst(v *vdl.Value, pkgPath string, imports codegen.Imports) string

UntypedConst returns the untyped vdl const corresponding to v, in the given pkgPath, with the given imports.

type NamedTypes Uses

type NamedTypes struct {
    // contains filtered or unexported fields
}

NamedTypes represents a set of unique named types. The main usage is to collect the named types from one or more signatures, and to print all of the named types.

func (*NamedTypes) Add Uses

func (x *NamedTypes) Add(t *vdl.Type)

Add adds to x all named types from the type graph rooted at t.

func (NamedTypes) Print Uses

func (x NamedTypes) Print(w io.Writer)

Print pretty-prints x to w.

Package vdlgen imports 9 packages (graph) and is imported by 3 packages. Updated 2020-10-22. Refresh now. Tools for package owners.