public static void AllocateMemory(Workspace Home, MemoryStruct Heap, ExpressionVisitor Evaluator, HScriptParser.DeclareMatrixLiteralContext context) { string name = context.IDENTIFIER().GetText(); CellAffinity type = GetAffinity(context.type()); MatrixVisitor vis = new MatrixVisitor(Home, Heap, Evaluator); CellMatrix mat = vis.ToMatrix(context.matrix_expression()).Evaluate(); Heap.Arrays.Reallocate(name, mat); }
internal static DeclareMatrixNode RenderDeclareNode(Workspace Home, ExpressionVisitor Evaluator, HScriptParser.DeclareMatrixLiteralContext context) { string name = context.IDENTIFIER().GetText(); MatrixVisitor MEvaluator = new MatrixVisitor(Home, Home.GlobalHeap, Evaluator); MNode node = MEvaluator.ToMatrix(context.matrix_expression()); return new DeclareMatrixNode(Home.GlobalHeap, name, node); }