@runtimeverificationinc/tsk
Version:
TypeScript/JavaScript library for K Framework functionality
156 lines (155 loc) • 5.49 kB
TypeScript
export type Location = [number, number, number, number];
export declare abstract class AST {
source?: string | null | undefined;
location?: (Location | null) | undefined;
constructor(source?: string | null | undefined, location?: (Location | null) | undefined);
}
export declare class Att extends AST implements Iterable<[string, string]> {
readonly items: Array<[string, string]>;
constructor(items?: Iterable<[string, string]>);
get(index: number): [string, string] | undefined;
get length(): number;
slice(start?: number, end?: number): Array<[string, string]>;
[Symbol.iterator](): Iterator<[string, string]>;
getValue(key: string): string | undefined;
has(key: string): boolean;
}
export declare const EMPTY_ATT: Att;
export declare abstract class Sentence extends AST {
}
export declare abstract class SyntaxSentence extends Sentence {
}
export declare enum Assoc {
LEFT = "left",
RIGHT = "right",
NON_ASSOC = "non-assoc"
}
export declare class SortDecl extends AST {
name: string;
readonly params: string[];
readonly args: string[];
constructor(name: string, params?: Iterable<string>, args?: Iterable<string>);
}
export declare class Sort extends AST {
name: string;
readonly args: Array<number | string>;
constructor(name: string, args?: Iterable<number | string>);
}
export declare class SyntaxDecl extends SyntaxSentence {
decl: SortDecl;
att: Att;
constructor(decl: SortDecl, att?: Att);
}
export declare class SyntaxDefn extends SyntaxSentence {
decl: SortDecl;
readonly blocks: PriorityBlock[];
constructor(decl: SortDecl, blocks?: Iterable<PriorityBlock>);
}
export declare class PriorityBlock extends AST {
assoc: Assoc | null;
readonly productions: ProductionLike[];
constructor(productions: Iterable<ProductionLike>, assoc?: Assoc | null);
}
export declare abstract class ProductionLike extends AST {
abstract att: Att;
}
export declare class Production extends ProductionLike {
att: Att;
readonly items: ProductionItem[];
constructor(items: Iterable<ProductionItem>, att?: Att);
}
export declare abstract class ProductionItem extends AST {
}
export declare class Terminal extends ProductionItem {
value: string;
constructor(value: string);
}
export declare class NonTerminal extends ProductionItem {
sort: Sort;
name: string;
constructor(sort: Sort, name?: string);
}
export declare class Lexical extends ProductionItem {
regex: string;
constructor(regex: string);
}
export declare class UserList extends ProductionLike {
sort: string;
sep: string;
nonEmpty: boolean;
att: Att;
constructor(sort: string, sep: string, nonEmpty?: boolean, att?: Att);
}
export declare class SyntaxSynonym extends SyntaxSentence {
newDecl: SortDecl;
old: Sort;
att: Att;
constructor(newDecl: SortDecl, old: Sort, att?: Att);
}
export declare class SyntaxPriority extends SyntaxSentence {
readonly groups: string[][];
constructor(groups: Iterable<Iterable<string>>);
}
export declare class SyntaxAssoc extends SyntaxSentence {
assoc: Assoc;
readonly klabels: string[];
constructor(assoc: Assoc, klabels: Iterable<string>);
}
export declare class SyntaxLexical extends SyntaxSentence {
name: string;
regex: string;
constructor(name: string, regex: string);
}
export declare abstract class StringSentence extends Sentence {
bubble: string;
label: string;
att: Att;
static readonly prefix: string;
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Rule extends StringSentence {
static readonly prefix = "rule";
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Claim extends StringSentence {
static readonly prefix = "claim";
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Config extends StringSentence {
static readonly prefix = "configuration";
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Context extends StringSentence {
static readonly prefix = "context";
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Alias extends StringSentence {
static readonly prefix = "context alias";
constructor(bubble: string, label?: string, att?: Att);
}
export declare class Import extends AST {
moduleName: string;
isPublic: boolean;
constructor(moduleName: string, isPublic?: boolean);
}
export declare class Module extends AST {
name: string;
att: Att;
readonly sentences: Sentence[];
readonly imports: Import[];
constructor(name: string, sentences?: Iterable<Sentence>, imports?: Iterable<Import>, att?: Att, source?: string | null, location?: Location | null);
}
export declare class Require extends AST {
path: string;
constructor(path: string);
}
export declare class Definition extends AST {
readonly modules: Module[];
readonly requires: Require[];
constructor(modules?: Iterable<Module>, requires?: Iterable<Require>);
}
export type ProductionItemType = Terminal | NonTerminal | Lexical;
export type ProductionLikeType = Production | UserList;
export type SentenceType = SyntaxSentence | StringSentence;
export type SyntaxSentenceType = SyntaxDecl | SyntaxDefn | SyntaxPriority | SyntaxAssoc | SyntaxLexical | SyntaxSynonym;
export type StringSentenceType = Rule | Claim | Config | Context | Alias;