2023-11-17 20:51:13 +03:00
|
|
|
/**
|
|
|
|
* Module: Models for RSLanguage.
|
|
|
|
*/
|
2023-09-11 20:31:54 +03:00
|
|
|
|
2025-02-18 19:40:24 +03:00
|
|
|
import { TokenID } from '../backend/types';
|
|
|
|
|
2024-08-26 22:53:27 +03:00
|
|
|
/**
|
|
|
|
* Represents alias mapping.
|
|
|
|
*/
|
|
|
|
export type AliasMapping = Record<string, string>;
|
|
|
|
|
2023-11-17 20:51:13 +03:00
|
|
|
/**
|
|
|
|
* Represents AST node.
|
2023-12-28 14:04:44 +03:00
|
|
|
*/
|
2023-09-11 20:31:54 +03:00
|
|
|
export interface ISyntaxTreeNode {
|
2023-12-28 14:04:44 +03:00
|
|
|
uid: number;
|
|
|
|
parent: number;
|
|
|
|
typeID: TokenID;
|
|
|
|
start: number;
|
|
|
|
finish: number;
|
2023-09-11 20:31:54 +03:00
|
|
|
data: {
|
2023-12-28 14:04:44 +03:00
|
|
|
dataType: string;
|
|
|
|
value: unknown;
|
|
|
|
};
|
2023-09-11 20:31:54 +03:00
|
|
|
}
|
2023-11-17 20:51:13 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents Syntax tree for RSLang expression.
|
2023-12-28 14:04:44 +03:00
|
|
|
*/
|
|
|
|
export type SyntaxTree = ISyntaxTreeNode[];
|
2023-09-11 20:31:54 +03:00
|
|
|
|
2023-11-17 20:51:13 +03:00
|
|
|
/**
|
|
|
|
* Represents function argument definition.
|
2023-12-28 14:04:44 +03:00
|
|
|
*/
|
2023-11-06 02:20:16 +03:00
|
|
|
export interface IArgumentInfo {
|
2023-12-28 14:04:44 +03:00
|
|
|
alias: string;
|
|
|
|
typification: string;
|
2023-09-11 20:31:54 +03:00
|
|
|
}
|
|
|
|
|
2024-11-20 00:33:25 +03:00
|
|
|
/** Represents global identifier type info. */
|
|
|
|
export interface ITypeInfo {
|
|
|
|
alias: string;
|
|
|
|
result: string;
|
|
|
|
args: IArgumentInfo[];
|
|
|
|
}
|
|
|
|
|
2023-11-17 20:51:13 +03:00
|
|
|
/**
|
|
|
|
* Represents function argument value.
|
2023-12-28 14:04:44 +03:00
|
|
|
*/
|
2023-11-06 18:03:23 +03:00
|
|
|
export interface IArgumentValue extends IArgumentInfo {
|
2023-12-28 14:04:44 +03:00
|
|
|
value?: string;
|
2023-11-06 02:20:16 +03:00
|
|
|
}
|
|
|
|
|
2025-02-18 19:40:24 +03:00
|
|
|
/** Represents error class. */
|
2023-09-11 20:31:54 +03:00
|
|
|
export enum RSErrorClass {
|
|
|
|
LEXER,
|
|
|
|
PARSER,
|
|
|
|
SEMANTIC,
|
|
|
|
UNKNOWN
|
2023-12-28 14:04:44 +03:00
|
|
|
}
|