schema

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Overview

Package schema defines constants used in the Kythe schema.

Index

Constants

View Source
const (
	NodeKindFact = "/kythe/node/kind"
	SubkindFact  = "/kythe/subkind"

	AnchorStartFact = "/kythe/loc/start"
	AnchorEndFact   = "/kythe/loc/end"

	SnippetStartFact = "/kythe/snippet/start"
	SnippetEndFact   = "/kythe/snippet/end"

	TextFact         = "/kythe/text"
	TextEncodingFact = "/kythe/text/encoding"
)

Kythe node fact labels

View Source
const (
	AnchorKind = "anchor"
	FileKind   = "file"
	NameKind   = "name"

	EnumKind     = "enum"
	FunctionKind = "function"
	PackageKind  = "package"
	RecordKind   = "record"
	VariableKind = "variable"
)

Kythe node kinds

View Source
const (
	ClassSubkind     = "class"
	EnumClassSubkind = "enumClass"
)

Kythe node subkinds

View Source
const (
	ChildOfEdge = EdgePrefix + "childof"
	NamedEdge   = EdgePrefix + "named"
	ParamEdge   = EdgePrefix + "param"
	TypedEdge   = EdgePrefix + "typed"
)

Kythe edge kinds

View Source
const (
	DefinesEdge        = EdgePrefix + "defines"
	DefinesBindingEdge = EdgePrefix + "defines/binding"
	DocumentsEdge      = EdgePrefix + "documents"
	RefEdge            = EdgePrefix + "ref"
)

Kythe edge kinds associated with anchors

View Source
const (
	// AnchorLocFilter is a fact filter for anchor locations
	AnchorLocFilter = "/kythe/loc/*"

	// SnippetLocFilter is a fact filter for snippet locations
	SnippetLocFilter = "/kythe/snippet/*"
)
View Source
const EdgePrefix = "/kythe/edge/"

EdgePrefix is the standard Kythe prefix for all edge kinds.

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(kind string) string

Canonicalize will return the canonical, forward version of an edge kind.

func IsAnchorEdge added in v0.0.13

func IsAnchorEdge(kind string) bool

IsAnchorEdge returns if the given edge kind is associated with anchors.

func IsEdgeVariant added in v0.0.13

func IsEdgeVariant(k1, k2 string) bool

IsEdgeVariant returns if k1 is the same edge kind as k2 or a more specific variant (i.e. IsEdgeVariant("/kythe/edge/defines/binding", "/kythe/edge/defines") == true). Note that IsEdgeVariant(k1, k2) == IsEdgeVariant(MirrorEdge(k1), MirrorEdge(k2)).

func MirrorEdge

func MirrorEdge(kind string) string

MirrorEdge returns the reverse edge kind for a given forward edge kind and returns the forward edge kind for a given reverse edge kind.

Types

type EdgeDir

type EdgeDir bool

EdgeDir represents the inherent direction of an edge kind.

const (
	Forward EdgeDir = true
	Reverse EdgeDir = false
)

Forward edges are generally depedency edges and ensure that each node has a small out-degree in the Kythe graph. Reverse edges are the opposite.

func EdgeDirection

func EdgeDirection(kind string) EdgeDir

EdgeDirection returns the edge direction of the given edge kind

Jump to

Keyboard shortcuts

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