import * as ast from "../grammar/ast"; import { ScopedBlock } from "../util"; import { Program } from "./program"; export declare class SemanticSymbol { declaration: ast.AnyAstNode; name?: ast.Name | undefined; constructor(declaration: ast.AnyAstNode, name?: ast.Name | undefined); static ErrorSymbol(): SemanticSymbol; } export declare enum TypeKind { Invalid = 0, Void = 1, Bool = 2, External = 3, Enum = 4, Port = 5, PortCollection = 6, Event = 7, Interface = 8, Component = 9, Namespace = 10, Function = 11, IntegerRange = 12, Integer = 13 } export declare enum SymbolKind { Any = 0, Type = 1, ConcreteType = 2 } export interface Type { kind: TypeKind; name: string; declaration?: ast.AnyAstNode; } export declare const ERROR_TYPE: { kind: TypeKind.Invalid; name: string; declaration: never; }; export declare const VOID_TYPE: { kind: TypeKind.Void; name: string; }; export declare const BOOL_TYPE: { kind: TypeKind.Bool; name: string; }; export declare const INTEGER_TYPE: { kind: TypeKind.Integer; name: string; }; export declare class TypeChecker { private program; constructor(program: Program); typeOfNode(node: ast.AnyAstNode): Type; private symbols; private builtInSymbols; private resolveNameInScopeTree; symbolOfNode(node: ast.AnyAstNode, symbolKind?: SymbolKind): SemanticSymbol | undefined; private isType; private isConcreteType; private findVariableInScope; resolveNameInScope(name: string, scope: ScopedBlock): SemanticSymbol | undefined; typeOfSymbol: (this: this, p: SemanticSymbol) => Type; getMembersOfType: (this: this, p: Type) => Map; private getOrCreateSymbol; findVariablesDeclaredInScope: (this: this, p: ScopedBlock) => Map; findAllVariablesKnownInScope: (this: this, p: ScopedBlock) => Map; private mergeNamespaces; }