.kotlin.kotlin-compiler.0.8.484.source-code.descriptors.proto Maven / Gradle / Ivy
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* 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.
*/
package org.jetbrains.jet.descriptors.serialization;
option java_outer_classname = "ProtoBuf";
option optimize_for = LITE_RUNTIME; // Smaller runtime
option java_generic_services = false; // Less code
message SimpleNameTable {
repeated string name = 1;
}
message QualifiedNameTable {
message QualifiedName {
optional int32 parent_qualified_name = 1 [default = -1];
required int32 short_name = 2;
optional Kind kind = 3 [default = PACKAGE];
enum Kind {
CLASS = 0;
PACKAGE = 1;
}
}
repeated QualifiedName qualified_name = 1;
}
message Type {
message Constructor {
enum Kind {
CLASS = 0;
TYPE_PARAMETER = 1;
}
optional Kind kind = 1 [default = CLASS];
required int32 id = 2; // CLASS - fqName id, TYPE_PARAMETER - type parameter id
}
required Constructor constructor = 1;
message Argument {
enum Projection {
IN = 0;
OUT = 1;
INV = 2;
}
optional Projection projection = 1 [default = INV];
required Type type = 2;
}
repeated Argument argument = 2;
optional bool nullable = 3 [default = false];
}
message TypeParameter {
required int32 id = 1;
required int32 name = 2;
optional bool reified = 3 [default = false];
enum Variance {
IN = 0;
OUT = 1;
INV = 2;
}
optional Variance variance = 4 [default = INV];
repeated Type upper_bound = 5;
}
message Class {
enum Kind {
// 3 bits
CLASS = 0;
TRAIT = 1;
ENUM_CLASS = 2;
ENUM_ENTRY = 3;
ANNOTATION_CLASS = 4;
OBJECT = 5;
CLASS_OBJECT = 6;
}
/*
Visibility
Modality
has_annotation
ClassKind
is_inner
*/
optional int32 flags = 1 [default = 0 /*internal final class, no annotations*/];
optional string extra_visibility = 2; // for things like java-specific visibilities
required int32 fq_name = 3;
message ClassObject {
// If this field is present, it contains serialized data for a synthetic class object, for which there's no class file.
// Otherwise class object was compiled to a separate class file and serialized data can be found in the annotation on that class
optional Class data = 1;
}
// This field is present if and only if the class has a class object. Its proto should be found either here or in the separate file
optional ClassObject class_object = 4;
repeated TypeParameter type_parameter = 5;
repeated Type supertype = 6;
// we store only names, because the actual information must reside in the corresponding .class files,
// to be obtainable through reflection at runtime
repeated int32 nested_class_name = 7;
repeated Callable member = 11;
repeated int32 enum_entry = 12;
message PrimaryConstructor {
// If this field is present, it contains serialized data for the primary constructor.
// Otherwise it's default and can be created manually upon deserialization
optional Callable data = 1;
}
// This field is present if and only if the class has a primary constructor
optional PrimaryConstructor primary_constructor = 13;
// todo: other constructors?
}
message Package {
repeated Callable member = 1;
}
message Callable {
enum MemberKind {
// 2 bits
DECLARATION = 0;
FAKE_OVERRIDE = 1;
DELEGATION = 2;
SYNTHESIZED = 3;
}
enum CallableKind {
// 2 bits
FUN = 0;
VAL = 1;
VAR = 2;
CONSTRUCTOR = 3;
}
/*
Visibility
Modality
has_annotations
CallableKind
MemberKind
hasGetter
hasSetter
hasConstant
*/
optional int32 flags = 1;
optional string extra_visibility = 2; // for things like java-specific visibilities
/*
isNotDefault
Visibility
Modality
has_annotations
*/
optional int32 getter_flags = 9 /* absent => same as property */;
optional int32 setter_flags = 10 /* absent => same as property */;
repeated TypeParameter type_parameter = 4;
optional Type receiver_type = 5;
required int32 name = 6;
message ValueParameter {
/*
declaresDefault
has_annotations
*/
optional int32 flags = 1;
required int32 name = 2;
required Type type = 3;
optional Type vararg_element_type = 4;
extensions 100 to 199;
}
// Value parameters for functions and constructors, or setter value parameter for properties
repeated ValueParameter value_parameter = 7;
required Type return_type = 8;
extensions 100 to 199;
}
enum Modality {
// 2 bits
FINAL = 0x00;
OPEN = 0x01;
ABSTRACT = 0x02;
}
enum Visibility {
// 3 bits
INTERNAL = 0x00;
PRIVATE = 0x01;
PROTECTED = 0x02;
PUBLIC = 0x03;
EXTRA = 0x04; // there's an extra field for the actual visibility
}