@akala/core
Version:
29 lines (28 loc) • 1.24 kB
TypeScript
import { Expression, type Expressions } from './expression.js';
import { ExpressionType } from './expression-type.js';
import { UnaryOperator } from './unary-operator.js';
import type { ExpressionVisitor } from './visitors/expression-visitor.js';
/**
* Represents a unary expression which applies an operator to a single operand.
*/
export declare class UnaryExpression extends Expression {
readonly operand: Expressions;
readonly operator: UnaryOperator;
/**
* Gets the type identifier for this expression.
* @returns {ExpressionType.UnaryExpression} The expression type constant
*/
get type(): ExpressionType.UnaryExpression;
/**
* Creates a new unary expression.
* @param {Expressions} operand - The operand value to which the operator is applied.
* @param {UnaryOperator} operator - The unary operator being applied (e.g., '+', '-', '!')
*/
constructor(operand: Expressions, operator: UnaryOperator);
/**
* Accepts a visitor to perform visitor pattern operations.
* @param {ExpressionVisitor} visitor - The visitor instance.
* @returns {any} The result from the visitor's visitUnary method.
*/
accept(visitor: ExpressionVisitor): Expressions;
}