public static void AllocateMemory(Workspace Home, MemoryStruct Heap, ExpressionVisitor Evaluator, HScriptParser.Crudam_declare_manyContext context) { foreach (HScriptParser.Declare_genericContext ctx in context.declare_generic()) { AllocateMemory(Home, Heap, Evaluator, ctx); } }
public static DeclarePlan RenderDeclarePlan(Workspace Home, HScriptParser.Crudam_declare_manyContext context) { ExpressionVisitor eval = new ExpressionVisitor(null, Home); DeclarePlan plan = new DeclarePlan(Home.GlobalHeap); foreach (HScriptParser.Declare_genericContext ctx in context.declare_generic()) { if (ctx is HScriptParser.DeclareScalarContext) plan.Add(RenderDeclareNode(Home, eval, ctx as HScriptParser.DeclareScalarContext)); else if (ctx is HScriptParser.DeclareMatrix1DContext) plan.Add(RenderDeclareNode(Home, eval, ctx as HScriptParser.DeclareMatrix1DContext)); else if (ctx is HScriptParser.DeclareMatrix2DContext) plan.Add(RenderDeclareNode(Home, eval, ctx as HScriptParser.DeclareMatrix2DContext)); else if (ctx is HScriptParser.DeclareMatrixLiteralContext) plan.Add(RenderDeclareNode(Home, eval, ctx as HScriptParser.DeclareMatrixLiteralContext)); } return plan; }