| /* |
| * Copyright 2018 The Kythe Authors. All rights reserved. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| syntax = "proto3"; |
| |
| package kythe.proto.schema; |
| |
| option go_package = "schema_go_proto"; |
| option java_package = "com.google.devtools.kythe.proto"; |
| |
| import "kythe/proto/storage.proto"; |
| |
| // Index between schema-defined strings and proto enums. |
| message Index { |
| message EdgeKinds { |
| string prefix = 1; |
| map<string, EdgeKind> edge_kind = 2; |
| } |
| message NodeKinds { |
| string prefix = 1; |
| map<string, NodeKind> node_kind = 2; |
| } |
| message Subkinds { |
| string prefix = 1; |
| map<string, Subkind> subkind = 2; |
| } |
| message FactNames { |
| string prefix = 1; |
| map<string, FactName> fact_name = 2; |
| } |
| |
| repeated EdgeKinds edge_kinds = 1; |
| repeated NodeKinds node_kinds = 2; |
| repeated Subkinds subkinds = 3; |
| repeated FactNames fact_names = 4; |
| } |
| |
| enum NodeKind { |
| UNKNOWN_NODE_KIND = 0; |
| |
| ABS = 1; |
| ABSVAR = 2; |
| ANCHOR = 3; |
| CONSTANT = 4; |
| DIAGNOSTIC = 5; |
| DOC = 6; |
| FILE = 7; |
| INTERFACE = 8; |
| FUNCTION = 9; |
| LOOKUP = 10; |
| MACRO = 11; |
| META = 12; |
| NAME = 13; |
| PACKAGE = 14; |
| PROCESS = 15; |
| RECORD = 16; |
| SUM = 17; |
| SYMBOL = 18; |
| TALIAS = 19; |
| TAPP = 20; |
| TBUILTIN = 21; |
| TNOMINAL = 22; |
| TSIGMA = 23; |
| VARIABLE = 24; |
| VCS = 25; |
| } |
| |
| enum Subkind { |
| UNKNOWN_SUBKIND = 0; |
| |
| CATEGORY = 1; |
| CLASS = 2; |
| CONSTRUCTOR = 3; |
| DESTRUCTOR = 4; |
| ENUM = 5; |
| ENUM_CLASS = 6; |
| FIELD = 7; |
| IMPLICIT = 8; |
| IMPORT = 9; |
| INITIALIZER = 10; |
| LOCAL = 11; |
| LOCAL_PARAMETER = 12; |
| METHOD = 13; |
| NAMESPACE = 14; |
| STRUCT = 15; |
| TYPE = 16; |
| UNION = 17; |
| } |
| |
| enum FactName { |
| UNKNOWN_FACT_NAME = 0; |
| |
| CODE = 1; |
| COMPLETE = 2; |
| CONTEXT_URL = 3; |
| DETAILS = 4; |
| DOC_URI = 5; |
| LABEL = 6; |
| LOC_END = 7; |
| LOC_START = 8; |
| MESSAGE = 9; |
| NODE_KIND = 10; |
| PARAM_DEFAULT = 11; |
| RULE_CLASS = 12; |
| SNIPPET_END = 13; |
| SNIPPET_START = 14; |
| SUBKIND = 15; |
| TEXT = 16; |
| TEXT_ENCODING = 17; |
| VISIBILITY = 18; |
| BUILD_CONFIG = 19; |
| } |
| |
| enum EdgeKind { |
| UNKNOWN_EDGE_KIND = 0; |
| |
| ALIASES = 1; |
| ALIASES_ROOT = 2; |
| ANNOTATED_BY = 3; |
| BOUNDED_LOWER = 4; |
| BOUNDED_UPPER = 5; |
| CHILD_OF = 6; |
| CHILD_OF_CONTEXT = 7; |
| COMPLETES = 8; |
| COMPLETES_UNIQUELY = 9; |
| DEFINES = 10; |
| DEFINES_BINDING = 11; |
| DEPENDS = 12; |
| DOCUMENTS = 13; |
| EXPORTS = 14; |
| EXTENDS = 15; |
| GENERATES = 16; |
| IMPUTES = 17; |
| INSTANTIATES = 18; |
| INSTANTIATES_SPECULATIVE = 19; |
| NAMED = 20; |
| OVERRIDES = 21; |
| OVERRIDES_ROOT = 22; |
| OVERRIDES_TRANSITIVE = 23; |
| PARAM = 24; |
| REF = 25; |
| REF_CALL = 26; |
| REF_CALL_IMPLICIT = 27; |
| REF_DOC = 28; |
| REF_EXPANDS = 29; |
| REF_EXPANDS_TRANSITIVE = 30; |
| REF_FILE = 31; |
| REF_IMPLICIT = 32; |
| REF_IMPORTS = 33; |
| REF_INCLUDES = 34; |
| REF_INIT = 35; |
| REF_INIT_IMPLICIT = 36; |
| REF_QUERIES = 37; |
| SATISFIES = 38; |
| SPECIALIZES = 39; |
| SPECIALIZES_SPECULATIVE = 40; |
| TAGGED = 41; |
| TYPED = 42; |
| UNDEFINES = 43; |
| } |
| |
| // A Node represents a Kythe graph node with all its known facts and edges. |
| message Node { |
| kythe.proto.VName source = 1; |
| |
| // Facts associated with the source VName (making exception for a small number |
| // of special-cases below). |
| repeated Fact fact = 2; |
| |
| // Edges associated with the source VName. |
| repeated Edge edge = 3; |
| |
| // Special-case for the ubiquitous /kythe/node/kind fact. This fact will not |
| // appear in the fact list above. |
| oneof kind { |
| NodeKind kythe_kind = 4; |
| string generic_kind = 5; |
| } |
| |
| // Special-case for the ubiquitous /kythe/subkind fact. This fact will not |
| // appear in the fact list above. |
| oneof subkind { |
| Subkind kythe_subkind = 6; |
| string generic_subkind = 7; |
| } |
| } |
| |
| // A Fact represents a single Kythe graph node fact. |
| message Fact { |
| kythe.proto.VName source = 1; |
| |
| // The fact's name. If standard, a Kythe FactName enum is used. Otherwise, |
| // the fact name will be represented as a string (as encoded in an |
| // Entry.fact_name). |
| oneof name { |
| FactName kythe_name = 2; |
| string generic_name = 3; |
| } |
| |
| bytes value = 4; |
| } |
| |
| // An Edge represents a single Kythe graph edge. |
| message Edge { |
| kythe.proto.VName source = 1; |
| kythe.proto.VName target = 2; |
| |
| // The edge's kind. If standard, a Kythe EdgeKind enum is used. Otherwise, |
| // the edge kind will be represented as a string (as encoded in an |
| // Entry.edge_kind without its ordinal). |
| oneof kind { |
| EdgeKind kythe_kind = 3; |
| string generic_kind = 4; |
| } |
| int32 ordinal = 5; |
| |
| Node source_node = 6; |
| Node target_node = 7; |
| } |
| |
| // A Kythe Entry represents a single graph node fact or edge. |
| message Entry { |
| oneof entry { |
| Fact fact = 1; |
| Edge edge = 2; |
| } |
| } |