public override int VisitCell([NotNull] GrammarParser.CellContext context) { try { string cellRef = context.GetText(); int column = 0; while (65 <= (int)cellRef[column] && (int)cellRef[column] <= 90) { column++; } int colNum = ColumnSys26.Sys26ToNum(cellRef.Substring(0, column)) - 1; int rowNum = int.Parse(cellRef.Substring(column)) - 1; ElectronicTableCell cell = CalculatingCell.Table.Cell(rowNum, colNum); if (cell.CurrentlyCalculating) { var ex = new Exception(); ex.Data.Add("Type", "cell loop"); throw ex; } cell.Depended.Add(CalculatingCell); CalculatingCell.Dependecies.Add(cell); cell.CurrentlyCalculating = true; int ans = cell.Count(); cell.CurrentlyCalculating = false; Console.WriteLine($"Value of {cellRef} is {ans}"); return(ans); } catch { throw; } }