private void AddSheetReferenceToken(string sheet)
        {
            object[] objArray1;
            string   text1 = this.GetCell();

            if (text1 == string.Empty)
            {
                this.Expected("3d sheet cell reference.");
            }
            sheet = sheet + "!" + text1;
            if (this.GetNextOnDemand(':'))
            {
                string text2 = this.GetCell();
                if (RefFormulaToken.IsCell(text2))
                {
                    objArray1 = new object[] { sheet + ":" + text2, this.worksheet.Parent };
                    this.AddToken(FormulaTokenCode.Area3d2, objArray1);
                }
                else
                {
                    this.Expected("3d area reference.");
                }
            }
            else
            {
                objArray1 = new object[] { sheet, this.worksheet.Parent };
                this.AddToken(FormulaTokenCode.Ref3d2, objArray1);
            }
        }
 private void AddCellOrRangeToken(string cellValue)
 {
     if (this.buffer.Peek() == RefFormulaToken.AbsoluteCellMark)
     {
         cellValue = this.GetCell();
     }
     if (this.GetNextOnDemand(':'))
     {
         string text1 = this.GetCell();
         if (RefFormulaToken.IsCell(text1))
         {
             this.AddArea(cellValue + ":" + text1);
         }
         else
         {
             this.Expected("Area.");
         }
     }
     else if (this.isFunctionArgumentsProcessed)
     {
         this.AddToken(FormulaTokenCode.Ref1, cellValue);
     }
     else
     {
         this.AddToken(FormulaTokenCode.Ref2, cellValue);
     }
 }
 private bool IsCell(string cellValue)
 {
     if (this.buffer.Peek() != RefFormulaToken.AbsoluteCellMark)
     {
         return(RefFormulaToken.IsCell(cellValue));
     }
     return(true);
 }
        public static bool IsCell(string match)
        {
            bool  flag1  = false;
            Match match1 = RefFormulaToken.IsCellRegex.Match(match);

            if (match1.Success && (match1.Value == match))
            {
                flag1 = RefFormulaToken.IsValidCell(match1);
            }
            return(flag1);
        }
        public static bool IsCellRange(string match)
        {
            bool  flag1  = false;
            Match match1 = AreaFormulaToken.IsCellRangeRegex.Match(match);

            if (match1.Success)
            {
                flag1 = RefFormulaToken.IsColumnValid(match1.Groups["Column1"].Value);
                flag1 = flag1 ? RefFormulaToken.IsColumnValid(match1.Groups["Column2"].Value) : flag1;
            }
            return(flag1);
        }
        private static bool IsValidCell(Match regexMatch)
        {
            string text1 = regexMatch.Groups["Row"].Value;

            if (text1[0] == RefFormulaToken.AbsoluteCellMark)
            {
                text1 = text1.Remove(0, 1);
            }
            string text2 = regexMatch.Groups["Column"].Value;

            if (text2[0] == RefFormulaToken.AbsoluteCellMark)
            {
                text2 = text2.Remove(0, 1);
            }
            if (RefFormulaToken.IsColumnValid(ExcelColumnCollection.ColumnNameToIndex(text2)))
            {
                return(RefFormulaToken.IsRowValid(ExcelRowCollection.RowNameToIndex(text1)));
            }
            return(false);
        }
        private string GetCell()
        {
            string text1 = string.Empty;

            if (this.GetNextOnDemand(RefFormulaToken.AbsoluteCellMark))
            {
                text1 = RefFormulaToken.AbsoluteCellMark + this.buffer.GetNextString(false);
            }
            else
            {
                text1 = this.buffer.GetNextString(false);
            }
            if (this.GetNextOnDemand(RefFormulaToken.AbsoluteCellMark, false))
            {
                text1 = text1 + RefFormulaToken.AbsoluteCellMark + this.buffer.GetNextString(false);
            }
            if (!RefFormulaToken.IsCell(text1))
            {
                this.Expected("Cell.");
            }
            return(text1);
        }
 public static bool IsRowValid(string match)
 {
     return(RefFormulaToken.IsRowValid(NumbersParser.StrToInt(match)));
 }