simc-ast-builder
Version:
Parser and AST generator for SimulationCraft files
64 lines • 2.55 kB
TypeScript
/**
* Factory for creating ExpressionNode instances
* Provides helper methods for creating nodes with appropriate defaults
*/
import { ExpressionNode } from "../parser/visitors/ast/common-types";
import { NodeBuilder } from "./NodeBuilder";
import { NodeTemplate } from "./NodeTemplate";
/**
* Factory for creating ExpressionNode instances
*/
export declare class NodeFactory {
/**
* Create a basic node
* @param type Type of the node
* @param options Additional options for the node
* @returns A new ExpressionNode
*/
static createBasic(type: string, options?: Partial<ExpressionNode>): ExpressionNode;
/**
* Create a binary operation node
* @param operator Operator for the binary operation
* @param left Left operand
* @param right Right operand
* @param expressionType Type of the expression
* @returns A new binary operation ExpressionNode
*/
static createBinaryOp(operator: string, left: ExpressionNode, right: ExpressionNode, expressionType?: "boolean" | "numeric" | "neutral"): ExpressionNode;
/**
* Create a Hekili node
* @param type Type of the node
* @param options Additional options for the node
* @returns A new ExpressionNode
*/
static createHekili(type: string, options?: Partial<ExpressionNode>): ExpressionNode;
/**
* Create a SimC node
* @param type Type of the node
* @param options Additional options for the node
* @returns A new ExpressionNode
*/
static createSimC(type: string, options?: Partial<ExpressionNode>): ExpressionNode;
/**
* Create a unary operation node
* @param operator Operator for the unary operation
* @param operand Operand
* @param expressionType Type of the expression
* @returns A new unary operation ExpressionNode
*/
static createUnaryOp(operator: string, operand: ExpressionNode, expressionType?: "boolean" | "numeric" | "neutral"): ExpressionNode;
/**
* Create a node from a builder
* @param builderFn Function that configures a NodeBuilder
* @returns A new ExpressionNode
*/
static fromBuilder(builderFn: (builder: NodeBuilder) => NodeBuilder): ExpressionNode;
/**
* Create a node from a template
* @param template Template to use
* @param values Values to override template defaults
* @returns A new ExpressionNode
*/
static fromTemplate(template: NodeTemplate, values?: Partial<ExpressionNode>): ExpressionNode;
}
//# sourceMappingURL=NodeFactory.d.ts.map