schema

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 12, 2016 License: Apache-2.0 Imports: 3 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"

	CompleteFact = "/kythe/complete"

	FormatFact = "/kythe/format"
)

Kythe node fact labels

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

	DocKind      = "doc"
	EnumKind     = "enum"
	FunctionKind = "function"
	PackageKind  = "package"
	RecordKind   = "record"
	TAppKind     = "tapp"
	VariableKind = "variable"
)

Kythe node kinds

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

Kythe node subkinds

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

Kythe edge kinds

View Source
const (
	CompletesEdge         = EdgePrefix + "completes"
	CompletesUniquelyEdge = EdgePrefix + "completes/uniquely"
	DefinesEdge           = EdgePrefix + "defines"
	DefinesBindingEdge    = EdgePrefix + "defines/binding"
	DocumentsEdge         = EdgePrefix + "documents"
	RefEdge               = EdgePrefix + "ref"
	RefCallEdge           = EdgePrefix + "ref/call"
)

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 DefaultTextEncoding = "UTF-8"

DefaultTextEncoding is the assumed value of the TextEncodingFact if it is empty or missing from a node with a TextFact.

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.

func ParseOrdinal added in v0.0.21

func ParseOrdinal(edgeKind string) (kind string, ordinal int, hasOrdinal bool)

ParseOrdinal removes an edge kind's `\.[0-9]+` ordinal suffix.

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 dependency 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