ConceptPortal-public/rsconcept/frontend/src/features/rsform/models/rslang.ts
Ivan 6e8192404f
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
R: Refactor type definitions
2025-02-18 19:40:24 +03:00

61 lines
986 B
TypeScript

/**
* Module: Models for RSLanguage.
*/
import { TokenID } from '../backend/types';
/**
* Represents alias mapping.
*/
export type AliasMapping = Record<string, string>;
/**
* Represents AST node.
*/
export interface ISyntaxTreeNode {
uid: number;
parent: number;
typeID: TokenID;
start: number;
finish: number;
data: {
dataType: string;
value: unknown;
};
}
/**
* Represents Syntax tree for RSLang expression.
*/
export type SyntaxTree = ISyntaxTreeNode[];
/**
* Represents function argument definition.
*/
export interface IArgumentInfo {
alias: string;
typification: string;
}
/** Represents global identifier type info. */
export interface ITypeInfo {
alias: string;
result: string;
args: IArgumentInfo[];
}
/**
* Represents function argument value.
*/
export interface IArgumentValue extends IArgumentInfo {
value?: string;
}
/** Represents error class. */
export enum RSErrorClass {
LEXER,
PARSER,
SEMANTIC,
UNKNOWN
}