@composita/symbols
Version:
Composita language symbols.
85 lines • 3.21 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageSymbol = exports.GenericComponentSymbol = exports.ComponentSymbol = exports.InterfaceSymbol = exports.BuiltInTypeSymbol = exports.ProcedureSymbol = exports.ConstantSymbol = exports.TypeSymbol = void 0;
const scope_symbols_1 = require("./scope-symbols");
var TypeSymbolTag;
(function (TypeSymbolTag) {
TypeSymbolTag[TypeSymbolTag["Tag"] = 0] = "Tag";
})(TypeSymbolTag || (TypeSymbolTag = {}));
class TypeSymbol extends scope_symbols_1.NamedScopeSymbol {
constructor() {
super(...arguments);
this._typeSymbolTag = TypeSymbolTag.Tag;
}
}
exports.TypeSymbol = TypeSymbol;
class ConstantSymbol {
constructor(identifier, type) {
this.identifier = identifier;
this.type = type;
}
}
exports.ConstantSymbol = ConstantSymbol;
class ProcedureSymbol extends TypeSymbol {
constructor(scope, identifier, parameters, returnType) {
super(scope, identifier);
this.parameters = parameters;
this.returnType = returnType;
}
}
exports.ProcedureSymbol = ProcedureSymbol;
var BuiltInTypeSymbolTag;
(function (BuiltInTypeSymbolTag) {
BuiltInTypeSymbolTag[BuiltInTypeSymbolTag["Tag"] = 0] = "Tag";
})(BuiltInTypeSymbolTag || (BuiltInTypeSymbolTag = {}));
class BuiltInTypeSymbol extends TypeSymbol {
constructor() {
super(...arguments);
this._builtInTypeSymbol = BuiltInTypeSymbolTag.Tag;
}
}
exports.BuiltInTypeSymbol = BuiltInTypeSymbol;
var InterfaceSymbolTag;
(function (InterfaceSymbolTag) {
InterfaceSymbolTag[InterfaceSymbolTag["Tag"] = 0] = "Tag";
})(InterfaceSymbolTag || (InterfaceSymbolTag = {}));
class InterfaceSymbol extends TypeSymbol {
constructor() {
super(...arguments);
this._interfaceSymbolTag = InterfaceSymbolTag.Tag;
// TODO add protocol here.
}
}
exports.InterfaceSymbol = InterfaceSymbol;
var ComponentSymbolTag;
(function (ComponentSymbolTag) {
ComponentSymbolTag[ComponentSymbolTag["Tag"] = 0] = "Tag";
})(ComponentSymbolTag || (ComponentSymbolTag = {}));
class ComponentSymbol extends TypeSymbol {
constructor(scope, identifier, genericType, isEntryPoint) {
super(scope, identifier);
this.genericType = genericType;
this.isEntryPoint = isEntryPoint;
this._componentSymbolTag = ComponentSymbolTag.Tag;
}
}
exports.ComponentSymbol = ComponentSymbol;
var GenericComponentSymbolTag;
(function (GenericComponentSymbolTag) {
GenericComponentSymbolTag[GenericComponentSymbolTag["Tag"] = 0] = "Tag";
})(GenericComponentSymbolTag || (GenericComponentSymbolTag = {}));
class GenericComponentSymbol extends ComponentSymbol {
constructor(scope, genericType) {
super(scope, '@@@__ANY__GENERIC_COMPONENT__@@@', genericType, false);
this._genericComponentSymbolTag = GenericComponentSymbolTag.Tag;
}
}
exports.GenericComponentSymbol = GenericComponentSymbol;
class MessageSymbol extends TypeSymbol {
constructor(scope, identifier, parameters) {
super(scope, identifier);
this.parameters = parameters;
}
}
exports.MessageSymbol = MessageSymbol;
//# sourceMappingURL=type-symbols.js.map
;